log4j - Jboss AS 7 logging on wrong level -
i have been trying use own log4j.xml file logging, suggested here: https://docs.jboss.org/author/display/as71/how+to#howto-howdoiuselog4j.propertiesorlog4j.xmlinsteadofusingtheloggingsubsystemconfiguration%3f
i did following things: - created jboss-deployment-structure.xml file in web-inf (since application war file) corresponding content; - put log4j-1.2.16.jar in build path; - created log4j.xml in src/main/resources (this spring roo put file when generated project).
this way, logging messages classes displayed ok, errors bubble , caught dispatcherservlet shown @ debug level in console:
12:06:30,668 debug [org.springframework.web.servlet.dispatcherservlet] (http-localhost- 127.0.0.1-8080-3) handler execution resulted in exception - forwarding resolved error view: modelandview: reference view name 'uncaughtexception'; model {exception=java.lang.nullpointerexception}: java.lang.nullpointerexception @ ro.radcom.muzee.bo.impl.jmsserviceimpl.sendmessage(jmsserviceimpl.java:29) [classes:] @ ro.radcom.muzee.web.homecontroller.redirectget(homecontroller.java:56) [classes:] @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) [rt.jar:1.6.0_33] @ sun.reflect.nativemethodaccessorimpl.invoke(unknown source) [rt.jar:1.6.0_33] ....
in standalone.xml, logging part looks this:
<subsystem xmlns="urn:jboss:domain:logging:1.1"> <console-handler name="console"> <level name="debug"/> <formatter> <pattern-formatter pattern="%d{hh:mm:ss,sss} %-5p [%c] (%t) %s%e%n"/> </formatter> </console-handler> <logger category="com.arjuna"> <level name="warn"/> </logger> <logger category="org.apache.tomcat.util.modeler"> <level name="warn"/> </logger> <logger category="sun.rmi"> <level name="warn"/> </logger> <logger category="jacorb"> <level name="warn"/> </logger> <logger category="jacorb.config"> <level name="error"/> </logger> <root-logger> <level name="debug"/> <handlers> <handler name="console"/> </handlers> </root-logger> </subsystem>
also, although log4j.xml contains this:
<logger name="org.springframework.security"> <level value="info" /> </logger>
in console there debug level logs such as:
"12:06:30,659 debug [org.springframework.security.web.access.intercept.filtersecurityinterceptor]"
- what causes?
are these 2 problems related in way?
any appreciated .
thank you.
** application server: jboss 7 ide: springsource tools suite
from logging subsystem perspective looks working should. spring printing debug
messages , have root logger set print them console handler.
your example messages using format logging subsystem. i'm not sure if have format defined in log4j.xml
configuration file, guess you're configuration file not found or used.
the key things using own log4j configuration are;
- make sure you're excluding servers log4j library (looks
jboss-deployment-structure.xml
- make sure include log4j library within deployment
- make sure log4j configuration file visible log4j in deployment
Comments
Post a Comment