[jboss-user] [Installation, Configuration & DEPLOYMENT] - Re: log4j config file behaviour

jaikiran do-not-reply at jboss.com
Wed Jul 8 04:40:59 EDT 2009


"brettcave" wrote : 
  | 
  | Ideally, I want to log ERROR to SMTP, CONSOLE and FILE for everything except for 1 or 2 categories, which I only want logged to CONSOLE / FILE

The "additivity" flag on a category will help in achieving this. Ex:

<category name="com.mycompany.package1" additivity="false">
  |   <priority value="ERROR" />
  |   <appender-ref ref="CONSOLE" />
  | </category>
  | 
  | <category name="com.mycompany.package2">
  |   <priority value="ERROR" />
  | </category>
  | 
  | <root>
  |   <priority value="INFO" />
  |   <appender-ref ref="SMTP" />
  |   <appender-ref ref="CONSOLE" />
  |   <appender-ref ref="FILE" />
  | </root>
  | 

Here com.mycompany.package1 will log only to the CONSOLE because the additivity flag is set to false. That flag can be used to specify that the log messages of a particular category are not to be propagated to the parent categories (the root in this case).


View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4242356#4242356

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4242356



More information about the jboss-user mailing list