Error loging for application
-
Hi all, In my project we had system to log the exceptions through creating a text file for each day and writing the exceptions occured during tht day. The exceptions will be cathed through exception handling applied for necessary events. There is system class called using 'System.Diagnostics' in .net. Through which we can enter details in to a cutom log and we can see the details . My point is it better to use the application orinted logging as we are doing or Is it better to use the 'System.Diagnostics.EventLog()' for logging the errors. Is any one worked on these concepts..? Please let me know the details. Thanks and Regards, yeggu
-
Hi all, In my project we had system to log the exceptions through creating a text file for each day and writing the exceptions occured during tht day. The exceptions will be cathed through exception handling applied for necessary events. There is system class called using 'System.Diagnostics' in .net. Through which we can enter details in to a cutom log and we can see the details . My point is it better to use the application orinted logging as we are doing or Is it better to use the 'System.Diagnostics.EventLog()' for logging the errors. Is any one worked on these concepts..? Please let me know the details. Thanks and Regards, yeggu
Hi there, As you already know that the EventLog[^] class allows you to write information to the window event log, so you can use it in your application for logging. However, using only the event log for logging in an application should not be flexible as your clients sometimes might want your application to log in a text file, or a datastore... other than the event log. So it is better to use a library like the log4net[^] or the Logging Application Block[^] in the Enterprise Lib for logging as they provide many more options.