You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Geert Mergan <gm...@europeaninvestor.com> on 2001/04/04 17:41:25 UTC

custom priorities

I can't get custom priorities to work (see below + attachments)...
Well they do work but not in the way they're supposed to.
Oh yes, I also tried using the DOMConfigurator, doesn't work
either. I figure there must be something wrong with my own
extensions of the log4j framework.


Can anybody figure out what's going on?

If you don't feel like figuring out my code, I would also
appreciate if you send me a working example (including
configuration file = very important)

By preference working example with priorities lower than DEBUG...


Geert <- puzzled





Given following java code: (standard categories)
================================================

Category one = Category.getInstance( "com.one.Test" );
Category two = Category.getInstance( "com.two.Test" );

one.error("one error");
one.fatal("one fatal");
two.error("two error");
two.fatal("two fatal");

results into the desired output (only one.error() does not get logged)


If I change to: (use my own factory)
====================================

log4j.categoryFactory=com.eic.util.logging.EicCategoryFactory

EicCategory one = EicCategory.getInstance( "com.one.Test" );
EicCategory two = EicCategory.getInstance( "com.two.Test" );

then one.error() is logged but it shouldn't be logged, should it?



I have following configuration file:
====================================

log4j.rootCategory=FATAL, STDOUT
log4j.category.com.two=ERROR
log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender
log4j.appender.STDOUT.File=System.out
log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout
log4j.appender.STDOUT.layout.ConversionPattern=%-9p # %d ### (%-20c{1}) %m%n