logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Maarten Bosteels" <mbosteels....@gmail.com>
Subject Re: Setting arbitrary substitution values in log4j.xml?
Date Fri, 12 Dec 2008 08:24:23 GMT
Hello Jakob,

I had the same question 10 months ago and found a workaround :
http://markmail.org/message/tevhpgptgesqvrgu
Maybe it's time to file an enhancement request.

Maarten

On Fri, Dec 12, 2008 at 1:45 AM, Jakob Homan <jghoman@gmail.com> wrote:

> I'm converting our project's log4j.properties to the log4j.xml in
> order to take advantage of the automatic rolling compression.
> Previously, we had lines such as:
>
> ourapp.log.dir=.
> ourapp.log.file= ourapp.log
>
> Which were then substituted later on in such lines as
> log4j.appender.DRFA.File=${ourapp.log.dir}/${ourapp.log.file}
>
> This allowed us to use the default values defined in the
> log4j.properties file or to redefine them at run time.
>
> My question is: how do I accomplish this within the log4j.xml?  I
> can't find anywhere in the DTD for defining arbitrary values.  It
> seems to work defining them as params within the root element, but it
> generates the following warning:
> log4j:WARN No such property [ourapp.log.dir] in
> org.apache.log4j.spi.RootLogger.
> log4j:WARN No such property [ourapp.log.file] in
> org.apache.log4j.spi.RootLogger.
>
> Can I find out if this is the correct way of doing this, and if so,
> how I can turn off that warning, or can I find the correct way to do
> this within log4j.xml?
>
> Thanks,
> Jakob Homan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message