You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-user@logging.apache.org by "RUOFF, LARS (LARS)" <la...@alcatel-lucent.com> on 2014/03/24 17:04:13 UTC

Does log4cxx substitute environment variables in config files?

Hi,
I heard that Log4J substitutes environment variables in log configuration files, that is, it is able to handle declarations like
<appender name="TRACES_FILE" class="FileAppender">
  <param name="file" value="${LOG_DIR}/traces.log"/>
...
(substituting the value for environment variable LOG_DIR)

Can log4cxx do this too?
Especially interested in v0.9.7, as I'm forced to use that version.
I don't see it in the documentation and code for now.

Kind Regards,
Lars R.


RE: Does log4cxx substitute environment variables in config files?

Posted by "RUOFF, LARS (LARS)" <la...@alcatel-lucent.com>.
Great! thank you.

-----Original Message-----
From: Thorsten Schöning [mailto:tschoening@am-soft.de] 
Sent: lundi 24 mars 2014 17:36
To: Log4CXX User
Subject: Re: Does log4cxx substitute environment variables in config files?

Guten Tag RUOFF, LARS (LARS),
am Montag, 24. März 2014 um 17:04 schrieben Sie:

> I heard that Log4J substitutes environment variables in log 
> configuration files, that is, it is able to handle declarations like
[...]
> Can log4cxx do this too?

Yes.

> Especially interested in v0.9.7, as I'm forced to use that version.

Should work there as well, at least the code is present like in newer versions. You may need to start debugging in DOMConfigurator::subst and follow the code from there. It works in 0.10.0 and above, because I use env vars substitution in 0.10.0 myself.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning       E-Mail:Thorsten.Schoening@AM-SoFT.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


Re: Does log4cxx substitute environment variables in config files?

Posted by Thorsten Schöning <ts...@am-soft.de>.
Guten Tag RUOFF, LARS (LARS),
am Montag, 24. März 2014 um 17:04 schrieben Sie:

> I heard that Log4J substitutes environment variables in log
> configuration files, that is, it is able to handle declarations like
[...]
> Can log4cxx do this too?

Yes.

> Especially interested in v0.9.7, as I’m forced to use that version.

Should work there as well, at least the code is present like in newer
versions. You may need to start debugging in DOMConfigurator::subst
and follow the code from there. It works in 0.10.0 and above, because
I use env vars substitution in 0.10.0 myself.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning       E-Mail:Thorsten.Schoening@AM-SoFT.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow