What solved my problem was basically what CTBrewski posted here (+1 by the way!) , But my App.config had an appSettings entry, not a configSections entry.
I moved the appSettings entry with my log4net configuration entries over the start entry, and the logs were then written to the user profile:
<configuration>
<appSettings>
<add key="log4net.Config" value="log4net.config" />
<add key="log4net.Config.Watch" value="True" />
<add key="ClientSettingsProvider.ServiceUri" value="" />
</appSettings>
<startup>
<supportedRuntime version="v2.0.50727" />
</startup>
...
...
And then, of course, my appender looks like this:
<appender name="RollingFile" type="log4net.Appender.RollingFileAppender">
<file value="${LOCALAPPDATA}/Synclio/Logs/SynclioWin.log" />
<appendToFile value="true" />
<maximumFileSize value="5000KB" />
<maxSizeRollBackups value="2" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%level %thread %logger - %message%newline" />
</layout>
</appender>
source
share