I use log4net for my desktop application written in c# and deployed using Visual Studio Extension "Microsoft Visual Studio Installer Projects" (MSI-Installer). After installation I do not see the log subfolder defined for log4net.
The TARGETDIR in "Microsoft Visual Studio Installer Projects" is defined as [ProgramFiles64Folder][Manufacturer]\[ProductName]
.
The log4net log file is defined as
<appender name="rollingFile" type="log4net.Appender.RollingFileAppender,log4net">
<param name="File" value=".\log\MyApp.log" />
<!-- ... -->
After installing the application via the "Microsoft Visual Studio Installer Projects"-created setup.exe and msi-installer I do not see the log-folder in the Windows explorer under Program Files\MyManufacturer\MyProductName although Show hidden files, folders, ... is set.
For testing purposes I added the following code to my application:
// does log file exist and grow ?
string currdir = Directory.GetCurrentDirectory();
MessageBox.Show(currdir, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
string[] sa = File.ReadAllLines(currdir + "\\log\\MyApp.log");
MessageBox.Show(sa.Length.ToString(), "Error", MessageBoxButton.OK, MessageBoxImage.Error);
// show lines created this year (2019)
string s = "";
for (int i = 0; i < sa.Length; i++)
{
if(sa[i].Contains("2019"))
s = s + sa[i] + "\n";
}
MessageBox.Show(s, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
So, the log file under Program Files\MyManufacturer\MyProductName\log\MyApp.log
can be accessed via the application and I see that it grows!
So the question is: Where is the log subdirectory ? How can I make it visible in the Wndows explorer ? Is this a permission issue ?