Open a-ney opened 8 years ago
I get this because its writing to the same log file from more than one process. I had to get one process to change the log name to get rid of this issue. Changing the log name is not easy as those class variables are not exposed.
// change a log name var target = new StreamingFileTarget(); if(includeName) target.FileNamingParameters.IncludeLogger = true; LogManagerFactory.DefaultConfiguration.AddTarget(LogLevel.Trace, LogLevel.Fatal, target);
Hi, I had the same issue, with my application crashing due to Unauthorized: Access denied exceptions. In my case it was because of my own code on app launch, simple mistake, I was not considering other code than mine. I wanted to delete all files older than 2 month on app start, but Metrolog wanted access for logging, and resulted in these exceptions. Metrolog on its own is handling multithreading nicely, I just messed it up with my code. So, asure your code won't interfere with Metrologs routines. Your issue is more than a year old, but maybe this will help other people.
I'm developing Windows Universal App and UnauthorizedAccessException is thrown every time just after any other exception.
I have set up
GlobalCrashHandler.Configure();
in App.xaml.cs BTW I use MetroLog with singleton wrapper (if it is important):