I need to write debugging messages from the same class to different files.
I mean, from the same class I need a specific debug statement to go to fileA, and another specific debug statement go to fileB.
If this is unclear, then I try to write network messages to a completely separate file than other loggin messages that this class issues.
If i do
<logger name="com.test.modules" additivity="false" >
<priority value="debug"/>
<appender-ref ref="netWorkCommunication"/>
<appender-ref ref="generalDebug"/>
</logger>
Then the log from my class will go to both files (since it is from the same package).
How can I configure log4j so that I can choose which logging operator from classes to com.test.modulesgo to , which appender file ?
source
share