I have a windows application that writes log files using log4net. The log file path in the app.config file is defined as:
<file type="log4net.Util.PatternString" value="Logs/LogFileName" />.
I have an msi installation project that installs the above application. I install the application on the development machine, run the installed application and, as expected, writes the log files to the directory, InstallDirectory / Logs /. The Dev machine has Win XP SP3 with all read rights.
But when I install the same on a test machine that has Windows 7, and I'm not sure of the permissions, there is no Logs directory and log files.
In both cases, InstallDirectory is C: \ Program Files \ Dir1 \ Dir2.
While I'm trying to figure out where the files are located on a test machine by adding:
log4net.Appender.FileAppender rootAppender = (log4net.Appender.FileAppender)((log4net.Repository.Hierarchy.Hierarchy)LogManager.GetRepository()).Root.Appenders[0]; string filename = rootAppender.File; MessageBox.Show(filename);
to the code, can someone shed some light.
- Why files may be missing?
- Does Win 7 have different ways to process new files on an installed Windows disk?
source share