The advantage of logging applicaiton blog over EventLog?

Topics: Logging Application Block
Sep 30, 2008 at 7:42 PM
I am going to write event log into Event Viewer/Application, what is the advantage of using Enterprise library over the following statement:

EventLog.WriteEntry(sSource, sEvent);
EventLog.WriteEntry(sSource, sEvent,
                EventLogEntryType.Warning, 234);


Oct 2, 2008 at 12:30 AM
Enterprise Library gives more flexibility, via configuration, on if, where and how various different log messages are written. If all your logging is always going to go to the event log regardless of environment, Enterprise Library probably does not have any advantages.  However if you need to route certain messages to a database, file, event logs, and/or email, using the Enterprise Library logging will be of assistance.