[prev in list] [next in list] [prev in thread] [next in thread] 

List:       log4net-user
Subject:    RE: Getting RollingLogFileAppender to write to Windows LocalAppData directory
From:       "David Abrames" <abramesd () kmbs ! konicaminolta ! us>
Date:       2008-09-19 14:34:43
Message-ID: 16D6444A0DB940EDA6215FCC688956A8 () sep ! net
[Download RAW message or body]

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic