Suppose I have these packages in my application – foo.bar and foo.foobar, And I want to send all log4j log messages that are coming from foo.bar package to foobar.log file and the log messages coming from foo.foobar to foofoobar.log file, how should I configure the log4j.xml file?
Share
You can use appender-ref in the logger configuration:
Have a look here for full examples.