Log4j.xml, same package, different level goes to different appender -
assume have 2 appenders console , file. package "my.package", want warn+ level logs go file , info+ level logs go console.
the following code send info+ level logs console, nothing goes file:
<category name="my.package"> <priority value="warn" /> <appender-ref ref="file" /> </category> <category name="my.package" additivity="false"> <priority value="info" /> <appender-ref ref="console" /> </category>
the following code cause error this:
log4j:error attempted append closed appender named [file].
<category name="my.package"> <priority value="warn" /> <appender-ref ref="file" /> </category> <category name="my.package"> <priority value="info" /> <appender-ref ref="console" /> </category>
how send warn+ level logs file , info+ level logs console?
Comments
Post a Comment