----- Messaggio originale -----
> Da: Ralph Goers <[email protected]>
> A: Log4J Users List <[email protected]>
> Cc:
> Inviato: Giovedì 7 Marzo 2013 19:00
> Oggetto: Re: Configuration file location programmatically
>
> In Log4j 2 it is the LoggerContext that is configured. You can cause the
> LoggerContext to pick up its configuration in one of a couple of ways:
> 1. Set the "log4j.configurationFile" system property before calling
> Log4j. This will allow you to have a default or single configuration.
> 2. Use one of the Configurator.initialize() methods. Note that the
> ClassLoader
> is important in Log4j 2. If you use the ClassLoaderContextSelector (the
> default)
> it will create LoggerContexts associated with the ClassLoader from which
> classes
> are calling LogManager.getLogger(). So if you are running in an application
> server where it has its own ClassLoader and each application has its own then
> you can use Configurator.initialize to create LoggerContexts for each of
> those
> ClassLoaders and have each have their own configuration.
>
> Ralph
Thanks Ralph, i'm using the second way.
Claudio Papa
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]