I have a Visual Studio project that gets installed to about half of the PCs in our company.
The application has an error logging routine that appends error messages to a text file that is kept here:
static string _appPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), Application.CompanyName);
For the most part, this works well and allows me to get to the log files on individual PCs.
It does not work everywhere. Some users have limited accounts, which do not have permissions to write to the Environment.SpecialFolder.CommonApplicationData
folder.
I could modify the path to store here:
static string _newPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), Application.CompanyName);
However, then when I need to collect log files, I must dig into every single user account folder on each PC to get to the logs.
What I would like to do is store these messages on our internal network. The problem with this is how to handle multiple write instances.
static string _netPath = Path.Combine(@"\\FileServer1", Application.CompanyName);
I'd like to use Messaging, but I'm not sure how to do that - or if it would be a good solution to this. Management wants me to push this update out this Friday (today is Wednesday).
What would be the easiest, most reliable method of using _netPath
to store log files from some 100 PCs in our network?
Note: Please, if you reference MSDN, paste the article. We have an old Microsoft ISA firewall that is not able to pass MSDN websites. (The ISA server times out every time, and it is so frusterating! See ISA Proxy Server can't... for my unanswered question on it.)