You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "O'Rourke, Frank" <F....@emuse-tech.com> on 2002/02/14 12:16:57 UTC

knowing if log4j has already been initialised

Hi
Is there a way to test is the log4j engine has already been configured.  I
am using log4j in my application which is running in JBoss + Jetty.  I wish
to be able to configure log4j if it has not already been configured by the
environment that I am executing in.  I access log4j through my own Factory
with a "public static Category getInstance(String name)" method.

Thanks

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: knowing if log4j has already been initialised

Posted by "tsmets@altern.org" <ts...@yahoo.com>.
You can either reset the Configurator but I would ot advise that solution.
Why don't you add your own factory a parameter where you can mention the
type of theAppender you wanna add ?

Smthg like :
public static Appender Factory.getAppender (Object, APPENDER_TYPE)
{
    // Make it singelton
    // ...
    switch (APPENDER_TYPE)
    {
    case NULL_APPENDER :
        return new NullAppender ();
    case STDOUT_APPENDER :
        return ...;
    case FILE_APPENDER :
        return ...;
    default :
        return NullAppender ();
    }
}


--
Thomas SMETS
rue J. Wytsmanstraat 62
1050 Bruxelles
yahoo-id : smetsthomas
----- Original Message -----
From: "O'Rourke, Frank" <F....@emuse-tech.com>
To: <lo...@jakarta.apache.org>
Sent: 14 February, 2002 12:16 PM
Subject: knowing if log4j has already been initialised


> Hi
> Is there a way to test is the log4j engine has already been configured.  I
> am using log4j in my application which is running in JBoss + Jetty.  I
wish
> to be able to configure log4j if it has not already been configured by the
> environment that I am executing in.  I access log4j through my own Factory
> with a "public static Category getInstance(String name)" method.
>
> Thanks
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>