File Logging stops ...

Topics: Building and extending application blocks, General discussion, Logging Application Block
Feb 28, 2008 at 8:07 PM
Hi all,

We have enterprise logging setup to log data to a File (Rolling Flat File Trace Listener). Everything seems to work fine in Dev.

When we moved to STG, we noticed that the Logging stopped after some time. This seemed to sort of coincide with the time the Application pool was restrated. Here are a couple of things that we noticed ..

  • We have impersoante = true in web.config and have around 50 users accessing the logs
  • We have implemented a Cache removed calback method, and the logs ALWAYS seem to stop working after this code is called (the user name for this one is empty). We do see previous cache removed entries(indicating that it is not that code), but it seems to always terminate with these entries and WE see this when we have no users...Usually stops at midnight or later!!!
  • The only way we can make it work again is by changing the fileName in the configuration section.

My best guesses rightnow are

  • I know that the Logging block uses a "ReaderWriter" lock for writting to these files.. Is this because the file is locked in some way by a thread and is never released ?
  • If we have like 50-100 users running the application will this be a problem ? (We have only 2 users in dev and that might e a reason we cant produce it there)

If anybody has any suggestions, pointers that would be greatly appreciated!

May 13, 2008 at 8:38 PM
I think we have same problem. We found out that if impersonate is true for the first user calling any of the methods (having log statements) of the service becomes the owner of the log file. And when the last user (before rolling happens) call any of the methods that user cannot rename the file created by the first user (because of the windows 2003 default privileges). We could not find any hints to solve this problem.

If you find anything please share...