This project has moved. For the latest updates, please go here.


RollingFileTraceListener: Write relative file paths to executable path


Using the RollingFileTraceListener on a Windows service logged on as 'Local Service' writes the log file to the C:\Windows\System32 directory. This is not the case with built in listeners like TextWriterTraceListener which correctly write to the application path.

I think you should always consider the path of the executable file as the base path for log files.
Closed Jun 10 at 4:57 AM by zijianhuang


zijianhuang wrote May 30, 2014 at 6:22 AM

This is partially covered by issue 35, so you will be able to use environment variable to define the directory, for example, %ProgramData%.

Generally, it does not sound good to write log file into System32 or any system or program folder which require high privilege to access.