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 "Abramson, Rami" <ra...@terayon.com> on 2002/12/19 07:27:02 UTC

setting a directory to the file in one of the file-appenders

Hello,

How is it possible to control the directory to which the log files are
written to.

	thank you,

              Rami A.
 

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: setting a directory to the file in one of the file-appenders

Posted by Thomas Muller <tt...@online.no>.
Both PropertyConfigurator and DOMConfigurator support rudimentary variable
interpolation from the System properties.

java -Dmylog.dir=/usr/home/foo/log Foo.java

And in your config file:

<appender name="FOO_APPENDER" class="org.apache.log4j.FileAppender">
	<param name="File" value="${mylog.dir}/foo.log" />
	<layout class="org.apache.log4j.PatternLayout">
  		<param name="ConversionPattern" value="%d{ABSOLUTE} [%x] [%t] - %m%n" />
	</layout>
</appender>

Hope this helps,

--

Thomas



| -----Original Message-----
| From: Abramson, Rami [mailto:rami.abramson@terayon.com]
| Sent: 19 December 2002 06:27
| To: Log4j-User (E-mail)
| Subject: setting a directory to the file in one of the file-appenders
|
|
| Hello,
|
| How is it possible to control the directory to which the log files are
| written to.
|
| 	thank you,
|
|               Rami A.
|
|
| --
| To unsubscribe, e-mail:
| <ma...@jakarta.apache.org>
| For additional commands, e-mail:
| <ma...@jakarta.apache.org>
|
|



*************************************************************************
Copyright ERA Technology Ltd. 2002. (www.era.co.uk). All rights reserved. 
The information supplied in this Commercial Communication should be treated
in confidence.
No liability whatsoever is accepted for any loss or damage 
suffered as a result of accessing this message or any attachments.

________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information on a proactive anti-virus service working
around the clock, around the globe, visit http://www.messagelabs.com
________________________________________________________________________

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>