Search code examples
tomcatlog4jprobe

Probe logs comming into my application log


I am using probe along with tomcat. My application which is deployed in tomcat 7 use log4j for its logging. I pass -Dlog4j.configuration for my application (on start).

I am getting logs from probe also in my application log file.

Why is it happening?


Solution

  • -Dlog4j.configuration will set this log4j configuration for all log4j related logging for all webapp deployed in tomcat process.

    So to specify separate log4j config per webapp, best way is to bundle it in your war.

    1. log4j.configuration at WEB-INF/classes/log4j.properties.
    2. Put log4j-xx.jar under WEB-INF/lib/log4j-xx.jar.