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 Debraj Manna <su...@gmail.com> on 2018/01/10 15:40:51 UTC

Rename log4j2.xml

Is it possible to have log4j configuration in some file other than
log4j.xml.?

In log back this can be done via -*Dlogback.configurationFile.*

*I am looking for something similar.*

Re: Rename log4j2.xml

Posted by Mikael Ståldal <mi...@apache.org>.
Now you can also use system property "log4j2.configurationFile" or 
environment variable "LOG4J_CONFIGURATION_FILE", according to:
http://logging.apache.org/log4j/2.x/manual/configuration.html#SystemProperties

BTW, the documentation says this is for XML or JSON configuration files, 
but it works for all types of configuration files. I just fixed that in Git.


On 2018-01-10 16:48, Ralph Goers wrote:
> As documented at http://logging.apache.org/log4j/2.x/manual/configuration.html#AutomaticConfiguration <http://logging.apache.org/log4j/2.x/manual/configuration.html#AutomaticConfiguration> you can use log4j.configurationFile.
> 
> Ralph
> 
>> On Jan 10, 2018, at 8:40 AM, Debraj Manna <su...@gmail.com> wrote:
>>
>> Is it possible to have log4j configuration in some file other than
>> log4j.xml.?
>>
>> In log back this can be done via -*Dlogback.configurationFile.*
>>
>> *I am looking for something similar.*
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Rename log4j2.xml

Posted by Ralph Goers <ra...@dslextreme.com>.
As documented at http://logging.apache.org/log4j/2.x/manual/configuration.html#AutomaticConfiguration <http://logging.apache.org/log4j/2.x/manual/configuration.html#AutomaticConfiguration> you can use log4j.configurationFile.

Ralph

> On Jan 10, 2018, at 8:40 AM, Debraj Manna <su...@gmail.com> wrote:
> 
> Is it possible to have log4j configuration in some file other than
> log4j.xml.?
> 
> In log back this can be done via -*Dlogback.configurationFile.*
> 
> *I am looking for something similar.*