-
1. Re: DEBUG level loggers not picking up ERRORs?
jaikiran May 7, 2012 3:22 AM (in response to nickarls)Your post is missing the logger/category configuration(s). Also can you post the log statement in your code?
-
2. Re: DEBUG level loggers not picking up ERRORs?
nickarls May 7, 2012 3:36 AM (in response to jaikiran)<root-logger> <level name="INFO"/> <handlers> <handler name="CONSOLE"/> </handlers> </root-logger>
<logger category="com.acme" use-parent-handlers="false"> <level name="DEBUG"/> <handlers> <handler name="APPLOG"/> </handlers> </logger>
<periodic-rotating-file-handler name="APPLOG"> <formatter> <pattern-formatter pattern="%d{HH:mm:ss} %X{sid}/%X{ip}:%X{user}@%X{inst} %-5p %s%E%n"/> </formatter> <file relative-to="jboss.server.log.dir" path="app.log"/> <suffix value=".yyyy-MM-dd"/> <append value="true"/> </periodic-rotating-file-handler>
(also tried a "level" element in the applogger
private static final Logger logger = Logger.getLogger(UtilServlet.class); catch (Exception e) { logger.fatal("oops", e); }
-
3. Re: DEBUG level loggers not picking up ERRORs?
jaikiran May 7, 2012 3:51 AM (in response to nickarls)1 of 1 people found this helpfulAssuming UtilServlet belongs to the com.acme package, then I expect the FATAL log message to be logged to app.log when that exception occurs. If that isn't happening then it appears to be a bug. Is this reproducible against latest nightly build? And you aren't having any application specific logging configuration files within your application, are you?
-
4. Re: DEBUG level loggers not picking up ERRORs?
nickarls May 7, 2012 5:54 AM (in response to jaikiran)Umm, nevermind - it appears that the exception escape from a constructor and was wrapped, no longer matching the category...
-
5. Re: DEBUG level loggers not picking up ERRORs?
jamezp May 7, 2012 11:55 AM (in response to nickarls)The exception shouldn't be used when determining the logging category. The logger category should be coming from your Logger.getLogger(UtilServlet.class). What logging framework/facade are you using?
-
6. Re: DEBUG level loggers not picking up ERRORs?
jaikiran May 7, 2012 12:05 PM (in response to jamezp)James Perkins wrote:
The exception shouldn't be used when determining the logging category. The logger category should be coming from your Logger.getLogger(UtilServlet.class). What logging framework/facade are you using?
I think what Nicklas meant was that the catch block in that constructor wasn't executed and instead the exception was caught and logged some place else by a different logger/category.
-
7. Re: DEBUG level loggers not picking up ERRORs?
jamezp May 7, 2012 12:08 PM (in response to jaikiran)Ah, that makes more sense then :-)