logging - How to filter out Jetty DEBUG messages in slf4j/log4j2? -
i added embedded jetty/jersey server application, uses log4j2 logging provider slf4j bindings. logging libraries in classpath , jetty uses them, described here:
https://www.eclipse.org/jetty/documentation/9.4.x/configuring-logging.html
this thing, except debug
level in jetty noisy, mentioned there.
i have 3 appenders (one console , 2 file) @ different levels, file name 1 of them configured programmatically, besides that, configuration specified in log4j2.properties
file. setup little complicated, need.
is there simple way convert jetty debug messages trace before message strings processed , / or filter out debug messages altogether based on package name?
i don't expect it's easy or or possible convert logging levels, doesn't hurt ask.
and far filtering concerned, in other words, i'd specify different levels depending on package, info
org.eclipse.jetty
, subpackages trace
default, or trace
package , subpackages info
default. ideally, should done in 1 place, doesn't have be.
i'm still little confused about loggers , appenders, got work partly trial , error. example, rootlogger.level
doesn't seem affect anything, i'm guessing can't specify filters through rootlogger
. references found suggest creating logger name matching specific class, i'm not sure how work problem -- work package/subpackage level filtering and, if so, need create multiple loggers write same appenders?
how give org.eclipse.jetty logger , set error level , additivity=false, , appender console or log, won't log root logger bother you.
<appenders> <console name="console" target="system_out"> <patternlayout pattern="%-5p:[%c.class(%c{1}.java:%l)] %m%n"/> </console> </appenders> <logger name="org.eclipse.jetty" level="error" additivity="false"> <appenderref ref="console"/> </logger>
Comments
Post a Comment