logging-log4net-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From NeerajG <neeraj.geh...@citi.com>
Subject Re: Create new log file each time application is started
Date Tue, 03 Feb 2009 03:13:08 GMT

You could put %processid as shown below.

<appender name="LogFileAppender" type="log4net.Appender.FileAppender">
    <file type="log4net.Util.PatternString"
value="log-file-[%processid].txt" />
    <layout type="log4net.Layout.PatternLayout" value="%date [%thread]
%-5level %logger - %message%newline" />
</appender>



Rob1234 wrote:
> 
> 
> Do you have any idea how I go about doing that? I can't find any
> configuration options which let you pass in a parameter to the file name.
> 
> Rob
> 
> 
> Ron Grabowski wrote:
>> 
>> You'd have to do something like include the process id (or other unique
>> identifier) in the file name for each instance.
>> 
>> 
>> 
>> ----- Original Message ----
>> From: Rob1234 <robert.sammons@lloydstsb.co.uk>
>> To: log4net-dev@logging.apache.org
>> Sent: Friday, November 28, 2008 8:54:40 AM
>> Subject: Create new log file each time application is started
>> 
>> 
>> Hi
>> 
>> I have a problem with log4net. I have an application which uses a
>> RollingFileAppender. The applcation can be started multiple times from
>> the
>> same location. I want there to be a seperate log file each time the
>> application is started. e.g. 5 apps running = 5 log files. Is there any
>> way
>> to do this in log4net?
>> 
>> -- 
>> View this message in context:
>> http://www.nabble.com/Create-new-log-file-each-time-application-is-started-tp20734792p20734792.html
>> Sent from the Log4net - Dev mailing list archive at Nabble.com.
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Create-new-log-file-each-time-application-is-started-tp20734792p21803201.html
Sent from the Log4net - Dev mailing list archive at Nabble.com.


Mime
View raw message