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 Javier Gonzalez <ja...@gmail.com> on 2006/02/15 14:16:02 UTC

Re: log4j:WARN No appenders could be found for logger

You could handle your configuration via a log4j config file (in xml or
properties format)
Much better than defining everything inside your source code, since that way
you can tweak the
logging configuration without recompiling.


On 2/15/06, Kamal Ahmed <KA...@webmethods.com> wrote:
>
> How do we resolve:
>
>
>
> How do we resolve:
>
> log4j:WARN No appenders could be found for logger
> (com.webmethods.sc.logging.test.unit.WmLoggerFilterTest).
>
> log4j:WARN Please initialize the log4j system properly.
>
>
>
> Step 1: Declare an Appender, e.g.
>
> ConsoleAppender a0 = new ConsoleAppender(new SimpleLayout());
>
>
>
> Step2: Declare a Logger e.g.
>
> Logger root = Logger.getRootLogger();
>
>
>
> Step3: attach the Appender to the logger e.g.
>
>                                       root.addAppender(a0);
>
>
>
>
>
> 1.      Is this correct?
>
> 2.      Is this the only way?
>
> Thanks,
>
> -Kamal.
>
>
>


--
Javier González Nicolini