Log4j multiple levels in multiple appenders

log4j

I have two appenders: console, and file
I have three packages uk.co.bar, uk.co.bar.foo, uk.co.pip

I need all messages (debug and higher) from uk.co.* to be fed into the file.

I want info messages from uk.co.bar.foo to fed to the console
I want all messages from uk.co.bar.pip to fed to the console

If I use a logger it restricts messages for both appenders. 🙁
If I use filters in the console appender I loose control of the package-level i want.

Anyone have a solution?

Best Answer

see this answer. As far as I understand this addresses your problem

Creating multiple log files of different content with log4j

Related Topic