Logging Quick Start

Topics: Logging Application Block
May 5, 2008 at 9:02 PM
I am using the EntLIb Logging to log to the event log. Every thing works fine untill I change the source attribute on the listeners mode to the name of my application. I used the example from the config file from the quick start logging sample. In the event log it lists the source as "Logging Quick Start" but I would like this to be the name of my app.

If I change it I get the error: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security.


<add name="Event Log Destination"

type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FormattedEventLogTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging"

listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging"

source ="Logging Quick Start"

formatter="Text Formatter"




Please help.


May 6, 2008 at 6:12 PM
Hi Sid,

Dealing with event log sources can be tricky. If a source already exists in the system (it is stored in the registry), then your app can just use it. However, if it doesn't exist the EventLog class used by the logger will try to create it and that requires admin privileges. Your safest move is to have an installer that will create your custom source, typically using installutil to run it.