This article describes an approach to writing to a custom error log and to writing events into the system event log.
Error logs are a useful method for collecting all error data generated by an application; this often includes trapped errors that you may not need to or care to show to the end user. Error logs are most useful during an early or beta release of a product where you have a limited set of users and you have an opportunity to capture the error logs back from these users. The error log class included with this example creates time stamped entries showing the exact method and line of code where the error occurred as well as the error message generated.
The event log is a system construct used to capture different types of information regarding the operational status of applications running on a system. Such log entries are categorized and made visible through the system event viewer console. Event logging is probably a better alternative to error logging in fully fielded systems.
download :
http://opensource.mam9.com/t285-topic...