logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zrbite1 <pingle...@gmail.com>
Subject Log4j Multiple log files, shared classes
Date Fri, 10 Feb 2012 22:41:40 GMT

My implementation uses Spring. I am trying to log to two different files, so
when my package abc.test1 logs a file, my logger will write to test1.log.
Same is true for abc.test2. 

However, both of them uses org.springframework. I want to be able to see
logging for org.springframework also, but only the relevant logs. This is
what it looks like now:

<logger name="abc.test1">
  <level value="debug"/>
  <appender-ref ref="test1"/>
<logger name="abc.test2">
  <level value="debug"/>
  <appender-ref ref="test2"/>
<logger name="org.springframework">
  <level value="debug"/>
  <appender-ref ref="test1"/>
  <appender-ref ref="test2"/>

 The way it is now, if abc.test1 makes a web service call, any
org.springframework messages will show up in both. How can I filter out
messages so that springframework messages show up in the correct log file
based on which web service (test1 or test2) actually called it?
View this message in context: http://old.nabble.com/Log4j-Multiple-log-files%2C-shared-classes-tp33303917p33303917.html
Sent from the Log4j - Users mailing list archive at Nabble.com.

To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org

View raw message