This is my handler:
<periodic-rotating-file-handler name="BATCH_HANDLER">
<level name="DEBUG"/>
<encoding value="UTF-8"/>
<formatter>
<pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] - %s%E%n"/>
</formatter>
<file path="/var/opt/myapp/logs/myapp.log"/>
<suffix value=".yyyy-MM-dd"/>
</periodic-rotating-file-handler>
with following:
<logger category="it.mydomain.mybatch" use-parent-handlers="false">
<handlers>
<handler name="BATCH_HANDLER"/>
</handlers>
</logger>
Now I'd like to have configured new handlers like BATCH_HANDLER with only the file path modified, and then a new logger category with different package.
Something like this:
<logger category="it.mydomain.mybatch.aaa">
<handlers>
<handler name="BATCH_HANDLER_1"/> <!-- inherits from BATCH_HANDLER except the file path -->
</handlers>
</logger>
<logger category="it.mydomain.mybatch.bbb">
<handlers>
<handler name="BATCH_HANDLER_2"/> <!-- inherits from BATCH_HANDLER except the file path -->
</handlers>
</logger>
<logger category="it.mydomain.mybatch.ccc">
<handlers>
<handler name="BATCH_HANDLER_3"/> <!-- inherits from BATCH_HANDLER except the file path -->
</handlers>
</logger>
Is there any way to add handlers that inherit BATCH_HANDLER with only file path changed ?