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 Sridharan Vembu <Sr...@infosys.com> on 2002/06/04 07:58:07 UTC

RE: Specifying location of log file

Hi,

How can I define the value for "myapp.home"in my configuration file itself. I tried defining it as a param under root tag. But , it doesnt reflect in the ${myapp.home}.Or can I have ways to define it programmatically.

Help on this would be highly appreciated.

Thanks & Regards
Sridharan

-----Original Message-----
From: Thomas Tuft Muller [mailto:ttm@online.no]
Sent: Wednesday, May 29, 2002 2:33 PM
To: Log4J Users List
Subject: RE: Specifying location of log file


Example

	<appender name="MY_APPENDER" class="org.apache.log4j.FileAppender">
		<param name="file" value="${myapp.home}/log/my-appender.log" />
		<param name="append" value="true" />
		<param name="threshold" value="DEBUG" />
		<layout class="org.apache.log4j.PatternLayout">
  			<param name="ConversionPattern"
  				value="%d{ISO8601} [%-5p] - &quot;%m&quot;%n" />
		</layout>
	</appender>

myapp.home must be set in the system properties before log4j is configured,
e.g. with the -D option.

Hope this helps.

--

Thomas



| -----Original Message-----
| From: Christian Selekman [mailto:Christian.Selekman@tietoenator.com]
| Sent: 29 May 2002 10:42
| To: Log4J Users List
| Subject: RE: Specifying location of log file
|
|
| Hello!
| I have still not been able solve my problem about choosing where
| the log file should be written. For example I have tried to use
| the System class method setProperty with keys "user.dir" and
| "java.class.path" where the value for both is put to the
| directory where I want my log to be written. This is also the
| same dir. where my config file for log4j is located. I am sure
| there is a way to specify the location of the log file and that
| some of you know the answer, so please spare a few minutes and
| help me out!
|
| Best regards
|
| > -----Original Message-----
| > From:	Abramovich, Boris [SMTP:babramo@qwest.com]
| > Sent:	den 17 maj 2002 17:43
| > To:	'Log4J Users List'
| > Subject:	RE: Specifying location of log file
| >
| > Add directory with your config file to your class path.
| >
| > -----Original Message-----
| > From: Christian Selekman [mailto:christian.selekman@tietoenator.com]
| > Sent: Friday, May 17, 2002 6:38 AM
| > To: 'log4j-user@jakarta.apache.org'
| > Subject: Specifying location of log file
| >
| >
| > Is there a way to specify where the log file will be written? I
| know it is
| > possible to for example name it in the XML configuration file,
| but where and
| > how do I specify a directory path if I want to control where
| the log file is
| > placed?
| >
| >
| > --
| > To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>

--
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 email 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>


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