I'm looking at switching to a new unified logging solution for use in our new line of products and I wanted to see what some of the people on Stack Overflow thought. We will need logging for a variety of applicatons: ASP .net, windows services, web services, wpf apps etc. We are a windows shop only.
Some of our requirements for a logging solution include:
1) Log file management
- Ability to split files up over a certain size
- Ability to auto archive/delete after certain period of time
2) Ability to send emails on certain types of messages logged (errors for example)
3) Ability to write messages to the windows event log
- We need to be able to specify where it's being written in the event log.
It would also be nice if it would automatically create the event log source if it does exist.
I've started looking at nLog, windows trace and log4net. I'm not limited to these 3 only it's just a few that came up a lot when searching.
log4net is always a good choice.
http://logging.apache.org/log4net/
Use .NET common logging. You can choose later a specific provider (NLog, CLog, log4net...), or even create custom ones.
And just another one: NLog.
- Files – single file or multiple, with automatic file naming and archival
- Event Log – local or remote Database – store your logs in databases supported
- by .NET Network – using TCP, UDP, SOAP, MSMQ protocols
- Command-line console – including color coding of messages
- E-mail – you can receive emails whenever application errors occur
- ASP.NET trace
- and many more
You can take a look at Enterprise Library, they have an application block for logging which is extensible
http://entlib.codeplex.com/
http://entlib.codeplex.com/releases/view/46741
you can download the dev guide pdf, they have a section on logging (Chapter 4)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With