简体   繁体   中英

Log4j custom appender doesn't “log” TRACE event

I am having an odd issue with a custom appender I am writing, it will not log trace LoggingEvents .

The purpose of the appender, is an experiment in writing appenders, and the use of a couple of other technologies (Gradle and assertJ for example), a self learning exercise, and to see if I can improve on using Mockito for capture of log messages during testing. I want the appender to capture all log levels and to that end I have implemented AppenderSkeleton and I set the threshold to ALL in the constructor.

During debug it doesn't even appear as if AppenderSkeleton.doAppend is evening being called.

Is trace different to the other levels somehow?

I have tried with and without SLF4J as my log manager, interestingly SLF4J doesn't seem to support fatal. Log4J version is 1.2.17.

确保使用自定义附加程序的记录器级别也为“ trace”

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM