By default, if you set the level of a logger/appender to debug, it will process debug, info, warn, error and fatal messages.
Is this what you want, or do you want to include only debug-level messages, and exclude info, warn, error and fatal messages? On Wednesday, October 2, 2013, fedinho wrote: > Thanks for your response Jacob. > > I've been looking at the additive feature, but I'm not sure it solves my > requirement. > > Given this configuration, I would like to debug class X on appender A, but > still keep the info level messages from class X on appender B. > > I was hoping that this line would make this happen, but doesn't seem to > work. > log4j.logger.classX=debug, A > > Is there a simple example similar to my requirements somewhere? > > Thanks > Fredrik > > > On Tue, Oct 1, 2013 at 6:50 PM, Jacob Kjome <[email protected] <javascript:;>> > wrote: > > > On Tue, 1 Oct 2013 18:17:41 +0200 > > fedinho <[email protected] <javascript:;>> wrote: > > > >> Hi. > >> > >> A simple question I hope someone can help me with. This is using log4j > >> 1.2.x > >> > >> I would like to log info level to one appender A and warn level to > another > >> appenderB. > >> > >> However, I would like to log debug messages from class X to appender A, > >> and > >> debug messages from class Y to appender B. > >> > >> Thanks for any tips for a configuration that will work. Threshold is not > >> the way to go. Is there a way A and B can have different root loggers or > >> categories? > >> > >> > > This is usually done by setting the logger additivity to "false" for > > either the logger in question or one it inherits from, which essentially > > makes the logger with additivity=false the root logger for all > inheritors. > > See... > > > > > http://logging.apache.org/**log4j/1.2/manual.html#**Appenders_and_Layouts< > http://logging.apache.org/log4j/1.2/manual.html#Appenders_and_Layouts> > > > > > > Kind regards > >> Fredrik > >> > > > > > > ------------------------------**------------------------------**--------- > > To unsubscribe, e-mail: log4j-user-unsubscribe@**logging.apache.org< > [email protected] <javascript:;>> > > For additional commands, e-mail: log4j-user-help@logging.**apache.org< > [email protected] <javascript:;>> > > > > >
