Logging to custom event log

Topics: Logging Application Block
Jan 27, 2009 at 12:01 PM
Edited Jan 28, 2009 at 12:31 AM
Hello,

I am trying to log information to a custom event log. I have created a custom event log as well. But somehow when i do a logger.write the information isnt getting written in the custom event log.But when i change the configuration to log it in an application log it is working fine.
Jan 28, 2009 at 2:06 AM

Hi,

Let me ask first, How did you created your custom Event Log? Anyway, It worked fine for me. I do it like this:

 

 

EventLog.CreateEventSource("Custom Source", "CustomLog");
Logger.Write("A message logged to the custom log.", "General");

 And I set the Properties of the "Formatted EventLog TraceListener" like this:

Log = CustomLog
Source = Custom Source

Because that is the Name and source that used for creating the custom event log.


Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Jan 29, 2009 at 1:44 AM
Hello,

Thanks a lot. The issue was i didnt supply the event source.Thats why it wasnt working.After setting the event source it seems to be working fine. Thanks