I have a Wicket 1.4.17 app in a standalone app in embedded Jetty 6.1.26.
My application uses log4j
over slf4j
.
My app consists of two JARs, core and web modules.
I have same log4j.properties
in both - by which I tried to exclude a possibility of some classloader not picking up .properties from non-web JAR.
For my classes, the log4j configuration works - e.g. the messages are on a single line. However, for Wicket, it seems to use some default.
How can I unify logging config?
BTW Jetty uses java.util.logging
开发者_Go百科.
Thanks, Ondra
http://logging.apache.org/log4j/1.2/manual.html#defaultInit
Well, try to use 2
from here:
Set the resource string variable to the value of the log4j.configuration system property. The preferred way to specify the default initialization file is through the log4j.configuration system property. In case the system property log4j.configuration is not defined, then set the string variable resource to its default value "log4j.properties".
In the end, it stopped behaving so after I cleaned up dependencies a bit.
http://code.google.com/p/ondrazizka/source/detail?r=187#
I removed pljFilter, which brought in commons-logging, so most probably that was causing problems. Can't explain, I'm not keen on logging config.
精彩评论