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 Jo...@it-informatik.de on 2007/02/23 11:56:27 UTC

RollingFileAppender and Windows service

Hi,

I'm writing an application that is running within an AppDomain that has 
been created by a Windows service. This framework is calling 
XmlConfigurator.ConfigureAndWatch and sets the ApplicationBase for my 
software to AppDomain.CurrentDomain.SetupInformation.ApplicationBase.

In my log4net config file I'm using RollingFileAppender that is described 
in the examples. And I've got the following behaviour. The latest 
'log.txt' is situated in the correct folder. But if the appender creates a 
new rolling file, the first file will be placed to c:\windows\system32. 
And the follwing rolling files are saved to the correct folder. 

Thanks for your help
Johannes

log4net: 1.2.9.0
cofnfig:
<appender name="FileAppender" type="log4net.Appender.RollingFileAppender">
  <file value="log.txt" />
  <appendToFile value="true" />
  <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
  <rollingStyle value="Date" />
  <datePattern value="yyyyMMdd-HH" />
  <layout type="log4net.Layout.PatternLayout">
    <conversionPattern value="%date [%thread] %-5level %logger - 
%message%newline" />
  </layout>
</appender>

***********************
This mail has been scanned by InterScan.
***********************