Dear John,

I use the following in my log4net.xml file:

<appender name="File" type="log4net.Appender.RollingFileAppender">
        <file value="${APPDATA}\MyApp\Logs\MyApp_log.txt"/>
        <appendToFile value="false" />
        <rollingStyle value="Size" />
        <maxSizeRollBackups value="10" />
        <maximumFileSize value="10MB" />
        <layout type="log4net.Layout.PatternLayout">
                <conversionPattern value="%d %c {%t} [%-5p] %M(%L)-%m%n"/>
        </layout>
</appender>

This resolves to "/Documents and Settings/MyLoginUser/Application
Data/MyApp/Logs" on XP 
and to "/Users/MyLoginUser/AppData/Roaming/MyApp/Logs on Vista.

'MyLoginUser' is the user name of the logged in User and normally these
folders are hidden by default so the User has to change their folder view
settings to display hidden folders to 'SEE' these folders.

One issue we have run into and I am working on is that for non-admin users
the 'Logs' folder is not created by log4net on Vista.  I am working on my
this and how to work around it.

David


Reply via email to