You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by Paul Brine <pd...@wayfarer.co.uk> on 2007/03/16 16:15:18 UTC
Specifying a different directory for logs
Hi,
Is it possible to write logs to a different directory other than the
executing assembly directory?
We are using the rolling file appender.
Regards
Paul Brine
Wayfarer Transit Systems Ltd
--------------------------------------------------------------------
*** This email may contain confidential information and/or copyright material. This email is intended for the use of the addressee only. Any unauthorized use may be unlawful. If you receive this email by mistake, please advise the sender immediately by using the reply facility in your email software. You should be aware that the contents of this email may be monitored to ensure compliance with the Wayfarer Transit Systems Ltd IT User policy. Wayfarer Transit Systems LTD Company Number: 1232487; VAT No: 187 7002 49 ***
RE: Specifying a different directory for logs
Posted by "McAninch, Robin J" <mc...@UPMC.EDU>.
Hi
Change your file value to set you path. In my example below I navigate
back to the root and then into a folder called Logfiles.
<appender name="RollingFile"
type="log4net.Appender.RollingFileAppender">
<file
value="../../../../../../../LogFiles/RemotePrintingService.log" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<maxSizeRollBackups value="10" />
<maximumFileSize value="5MB" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread]
%-5level [%property{NDC}] - %message%newline" />
</layout>
</appender>
Good Luck
Robin McAninch
________________________________
From: Paul Brine [mailto:pdbrine@wayfarer.co.uk]
Sent: Friday, March 16, 2007 11:15 AM
To: log4net-user@logging.apache.org
Subject: Specifying a different directory for logs
Hi,
Is it possible to write logs to a different directory other than the
executing assembly directory?
We are using the rolling file appender.
Regards
Paul Brine
Wayfarer Transit Systems Ltd
________________________________
*** This email may contain confidential information and/or copyright
material. This email is intended for the use of the addressee only. Any
unauthorized use may be unlawful. If you receive this email by mistake,
please advise the sender immediately by using the reply facility in your
email software. You should be aware that the contents of this email may
be monitored to ensure compliance with the Wayfarer Transit Systems Ltd
IT User policy. Wayfarer Transit Systems LTD Company Number: 1232487;
VAT No: 187 7002 49 ***