Logs in a Windows Service are not written to the path of the exe because the windows service is started in another directory. What's the best way to write the logs to the AppDomain.CurrentDomain.BaseDirectory?
This is my appender:
<appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
<!--<file value="Logs/Log4Net/"/>-->
<appendToFile value="true"/>
<rollingStyle value="Date"/>
<staticLogFileName value="false"/>
<lockingModel type="log4net.Appender.FileAppender+MinimalLock"/>
<datePattern value="yyyy-MM-dd-HH.lo\g"/>
<maximumFileSize value="1MB"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %-5level %logger - %message%newline"/>
</layout>
</appender>
I have found a way to set it dynamically in code, but no way to set it right in the xml configuration...