You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by zrbite1 <pi...@gmail.com> on 2012/02/10 23:41:40 UTC

Log4j Multiple log files, shared classes

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>
<logger name="abc.test2">
  <level value="debug"/>
  <appender-ref ref="test2"/>
</logger>
<logger name="org.springframework">
  <level value="debug"/>
  <appender-ref ref="test1"/>
  <appender-ref ref="test2"/>
</logger>

 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