logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Drier" <peter.dr...@gmail.com>
Subject Re: how to log to differnent textfiles?
Date Mon, 19 May 2008 14:46:41 GMT
Hi,

You can use environment variables and a few pre defined ones in the
conversion pattern for the filename..  e.g.

        <appender name="DefaultAppender"
type="log4net.Appender.RollingFileAppender">
            <file type="log4net.Util.PatternString">
                <conversionPattern
value="C:\Logs\Application-%date{yyyy.MM.dd.HH.mm.ss}-[%processid].log" />
            </file>
            <threshold value="ALL"/>
            <appendToFile value="true" />
            <rollingStyle value="Size" />
            <maximumFileSize value="50MB" />
            <maxSizeRollBackups value="5" />
            <layout type="log4net.Layout.PatternLayout">
                <conversionPattern value="%date [%15.15thread] %-5level
%logger{2} - %message%newline" />
            </layout>
        </appender>

-Peter

On Mon, May 19, 2008 at 7:53 AM, Drinck@gmx.de <Drinck@gmx.de> wrote:

> Hello!
>
> Thanks for reply!
>
> Yes, it works. But when I log many entries in both processes I receive a
> log4net:ERROR [RollingFileAppender] Unable to acquire lock on file
> and after that an INTERNAL ERROR. Append is False but OutputFile ...
> already exists.
>
> There is no way to set the logfile path manual?
> Or can I specify the folder to user data folder?
>
> best regards,
> Mad
>

Mime
View raw message