TraceListeners are not creating log file

Topics: General discussion, Logging Application Block
Mar 8, 2010 at 10:20 PM

I have a Windows 2003 environment where I am using EntLib for logging to flat file, event log and send an email.

This code works great in Test environment [same OS as prod windows 2003], but does not produce any of the expected logging [to file and event log], neither does it send any emails. I did not install EntLib on the Test server and it works great. So I don't think I should need to do that on Prod. What am I missing here? Any pointers are appreciated. Thanks.

Mar 9, 2010 at 12:53 AM

Does your production configuration change in any way from the Test environment?  If so, is it deployed?

At least for flat file logging, ensure that application execution context (ASPNET or impersonated) has the appropriate permissions.

Mar 9, 2010 at 3:21 PM

Production environment has higher security level than Test environment. Also this is a windows console application running under "Network Service". I have verified that this user has create permissions on the log folder.

Mar 9, 2010 at 8:08 PM

I have now got a clone of production machine into test. The program logs perfectly fine on this cloned version without making any changes. I am lost even further now. Not sure what security setting I need to check. Need some real help here.

Mar 9, 2010 at 9:03 PM


a console application usually runs in the context of a user.  Therefore, executing account should have Read, Write, Execute permissions on the folder.  However, I would ensure that configuration (exe.config) in the production system is correct as you mention that non of trance listeners are outputing log data.  Does your application swallow all exceptions?

Mar 9, 2010 at 9:09 PM

The executing user has all the necessary permissions. I even tried with local admin id. Since the exact same application [without any code or config changes] is working fine on the cloned box in test domain, I don't suspect this to be an application issue. I am more leaning towards some group policy settings that is preventing Ent Lib listeners from working.

Mar 10, 2010 at 6:47 AM

Hi Tusharpat,

One thing that might help you in diagnosing the problemi is to add a Event Log trace listener in the "Logging Errors & Warnings" section of the logging application block. Any failures or exception that occured during the logging process will be logged to the event log. Please try.

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.

Mar 16, 2010 at 1:22 PM


The problem as we found out there was a missing DNS entry for the mail forwarder. This caused the logging to fail to write to the event log at all and nothing was ever written to the event log. Is there a way to put out an exception if this occurs. Would loading the instrumentation help or does there need to be some type of exception handler writen. Are there other errors in the application bock that an exception handler might help?