logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Pepper" <sip.sni...@gmail.com>
Subject Re: log settings an administrator's job?
Date Wed, 20 Aug 2008 22:55:55 GMT
Thanks for that, Jake. I think I've seen something similar to your
referenced ContextJNDISelector discussed in an article by Ceki Gülcü
(http://www.qos.ch/logging/sc.jsp).

I'm a little surprised that log4j configuration doesn't currently
offer sys admin configuration facilities straight out of the box, and
hence the uncertain tone of my original question! I'll post back to
this list if I implement anything worth reporting.

Paul.

2008/8/20 Jacob Kjome <hoju@visi.com>:
> It's not a bad idea.  Log4j 1.2.xx gives you one option.  On the command
> line that starts the server, the sysadmin can add...
>
> java -Dlog4j.configuration=/path/to/log4j.xml .....
>
> Of course, if you have more than one app running on the server and you want
> separate config files per app (assuming you have the inherent capability for
> separation via child-first classloading or a custom repository selector),
> then you'll have to come up with something more like you idea about
> configuring it as a JNDI String resource.
>
> Such capability was implemented in the abandoned 1.3 experiment as the
> ContextJNDISelector [1].  You could adapt this code to your liking.  I would
> actually like to see this in the extras and in Log4j 2.0 if it ever comes
> into being.
>
> [1]
> http://svn.apache.org/repos/asf/logging/log4j/branches/BRANCH_1_3_ABANDONED/src/main/java/org/apache/log4j/selector/ContextJNDISelector.java
>
>
> Jake
>
> On Wed, 20 Aug 2008 13:45:55 +0100
>  "Paul Pepper" <sip.sniffa@gmail.com> wrote:
>>
>> Placing log4j settings in the log4j.properties (or log4j.xml) file
>> under WEB-INFO/classes effectively requires the developer to configure
>> logging - e.g. unexploded war files. Shouldn't it be the job of the
>> system admin who deploys the application to configure things like log
>> file location? Or have I missed something?
>>
>> I would like to give the system admin the ability to set the location
>> of the log4j log file in my applications (as with access log info when
>> a sys admin can use org.apache.catalina.valves.AccessLogValve in
>> Tomcat's server.xml). The server.xml (or context.xml) seems like the
>> right place to set the location of the log4j log file - maybe as a
>> JNDI string resource.
>>
>> Can anyone suggest a way of giving system administrators the means of
>> setting log4j configuration settings? Or, can anyone explain why this
>> would be a bad idea?
>>
>> Thanks,
>>
>> Paul.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>> For additional commands, e-mail: log4j-user-help@logging.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

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


Mime
View raw message