logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Ebersole" <steveebers...@austin.rr.com>
Subject Re: log4j initialization problems
Date Sun, 13 Jan 2002 12:34:48 GMT

----- Original Message -----
From: "Armin Zeltner" <Armin.Zeltner@t-online.de>
To: <log4j-user@jakarta.apache.org>
Sent: Sunday, January 13, 2002 4:24 AM
Subject: log4j initialization problems


> Hi
>
> I've the following sequence:
>         Category root=Category.getRoot();
>         root.addAppender(new ConsoleAppender());
>         Category log=Category.getInstance(XYZ.class.getName());

This by itself does not initialize log4j.  You need to do a properties/XML
file init or explicitly call one of the configure methods prior to trying to
obtain a Category.  For the simplist way, simply do :
    BasicConfigurator.configure();
    Category log=Category.getInstance(XYZ.class.getName());
    ....


> .....
>     log.debug("abcdef");
>
> and I get the following error:
> log4j:ERROR No appenders could be found for category (XYZ).
> log4j:ERROR Please initialize the log4j system properly.
>
>
> I really the initialization of root or any parent category not sufficient?
>

Again, simply obtaining root does not configure the log4j system.



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


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


Mime
View raw message