logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dave Bender" <dben...@umn.edu>
Subject newbie: trouble making sub category log differently
Date Tue, 02 Apr 2002 21:17:25 GMT
I must be missing something obvious, but I cannot get a Category of mine to
log to a location other than that of the rootCategory. Can someone point out
what I'm missing?

The behaviour I'd like is for all loggers to output to a file, except for
one category, which should log to the console. I've defined "A1" and "A2" as
my appenders and both are functional, in that if I assign the root category
to go there, everything goes where it's instructed to go.

But if I assign my category, umn.edu.cidrap.admin.ContentBean, to use one or
the other or both, it doesn't. The output goes where the rootCategory is
defined to go.

Any help would be appreciated. I think I've covered all the documentation,
but if it's there, I'm not seeing it.

Dave Bender

# define which appenders to use for our categories/loggers
log4j.rootCategory=DEBUG, A1
log4j.category.umn.edu.cidrap.admin.ContentBean=, A2

# A1 is set to be a ConsoleAppender which outputs to System.out.


# A1 uses PatternLayout; so does A2

# The conversion pattern uses format specifiers. Both the same.
log4j.appender.A1.layout.ConversionPattern=%-4r %-5p [%t] %37c %3x - %m%n
log4j.appender.A2.layout.ConversionPattern=%-4r %-5p [%t] %37c %3x - %m%n

To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>

View raw message