I use log4j and would like to route the output of certain Loggers to specific files.
I already have multiple appenders in place. Now, to make debugging easier, I want to tell log4j that the output generated by a specific class (e.g. foo.bar.Baz) should be written to a specific log file.
Can this be done?
Here's an answer regarding the XML configuration, note that if you don't give the file appender a
ConversionPattern
it will create 0 byte file and not write anything:An example: