I have defined two loggers MainLogger, SecondLogger which logs the debug statements to two separate files Main.log and Second.log respectively and defined the categories like
<appender name="MainLogger" class="org.apache.log4j.FileAppender">
<param name="File" value="Main.log" />
</appender>
<appender name="SecondLogger" class="org.apache.log4j.FileAppender">
<param name="File" value="Second.log" />
</appender>
<category name="Fully.Qualified.ClassA" additivity="false">
<priority value="INFO" />
<appender-ref ref="MainLogger" />
</category>
<category name="Fully.Qualified.ClassB" additivity="false">
<priority value="INFO" />
<appender-ref ref="SecondLogger" />
</category>
The issue is, both the work flows share the ClassA and ClassB. So the Main.log is filled with high traffic work flow which is difficult to manage.
How do I limit the work flows to go to respective log files only?
Is there any solution to route the current thread log statements to one particular log file only?