Posts

Showing posts from March, 2017

Log4Net Primer

My notes on Log4Net, which is a great logging utility I've been using in a lot of console apps lately. It's beautiful. References: Great Introduction Video by Tim Corey - the first 45 minutes were sufficient for me: https://www.youtube.com/watch?v=2lAdQ_QwNww&feature=youtu.be Tim Corey’s original article: http://www.codeproject.com/Articles/140911/log-net-Tutorial Official Documentation, very thorough: http://logging.apache.org/log4net/index.html Summary: log4Net is a great logging tool for .Net applications. You can log at different “levels” like Debug, Info, Warn, Error, Fatal, and send different levels of logging to different places. For example all messages could go to the console, but Error or Fatal messages can go to a log file or a database. The basic steps are: Add log4Net to your program via NuGet Configure log4Net settings in your App.config Configure various “appenders” for all the targets you want to log to, and what format of