Multiple appenders for different packages
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Wednesday, June 2, 2004 02:39 AM

Hi!

is it possible to log with one appender all massages, and with another appender only messages from package com.foo ?
package ?

What i want to achieve:

- Log ALL massage in one general logfile.

- Log fatal messages (from ONE PACKAGE only) in a separate file.

best regards,
Robby

Re: Multiple appenders for different packages

Posted By:   Sean_Owen  
Posted On:   Wednesday, June 2, 2004 07:58 AM

Yes -- attach one appender to the root logger, and then attach a different appender to the "com.foo" logger. Messages to the "com.foo" logger will go to both appenders. See the log4j manual: http://logging.apache.org/log4j/docs/manual.html
About | Sitemap | Contact