Event Log entries being written on local development machine but not on server

Topics: Logging Application Block
Feb 27, 2008 at 10:35 PM
I am using the Logging application block to write errors and informational messages from a web site to the machine's event log. When developing the solution in Visual Studio, the log entries are written correctly. However, on the server, the entries are simply not written. No exception is thrown, and no other errors are logged in the event log around the same time to indicate that some access privilege was unavailable. It appears to fail completely silently.

The call is a simple Logger.Write(message);, and the event log source is already registered on the server. The web site uses integrated authentication.

Interestingly, if I add an <identity impersonate="true" userName="user" password="password" /> element to the web.config file, the log-writing succeeds. This causes problems when attempting to build the solution locally, though, when the impersonated user lacks access to "Temporary ASP.NET Files" subfolders.

What is the best solution for allowing the relatively low-privilege site to write log entries using the Enterprise Library Logging block?
Mar 7, 2008 at 4:56 PM
I was running the same issue and after almost going mad, I found out the problem was caused by the instrumentation features of EL.
Just run "Instal Instrumentation", available in start menu after completing the EL setup. It worked for me.

Without instrumentation the code runs fine, do not throw errors, but with no logging, no warnings, no trace, no nothing.

Hope it helps.