I just started using Log4Net and was looking to see what you have found to be useful in your logging experiences.
What types of things have you found to be useful to log; what ended up being just noise; when do you use the different logging levels (DEBUG, INFO, etc); do you have a standard format for each log entry; are there things you ALWAYS log?
Any pitfalls? Good articles on logging in general?
Update: Where do you log to? What Appenders and why?
Thank you!
ERROR
level at the highest level in the call stack that is possible (typically in event handlers etc)WARN
level (because it might indicate that we need to improve our UI to better guide the user)INFO
level (i.e. anything that involves billing a customer's credit card, queries to a third party API etc), including the data involved (typically XML serialized, with any sensitive information removed)DEBUG
levelWe seldom use
FATAL
level logging.We normally deploy with a
RollingLogFileAppender
atINFO
level, and anSmtpAppender
atERROR
level.There's another log4net log viewer (other than the Apache Chainsaw) which my company has been using for some time, it's called "log4net Dashboard" and is being developed by a Norwegian company (I think) called FaktNet, it's website is http://www.l4ndash.com.
It provides a web based dashboard which is quite intuitive and provides a good overview on the log, can be used with many different appenders (such as rolling file or SQL-server appender) but it isn't free as the Apache Chainsaw is. They do have a developer's license though, which is free and allows local use only, which would be sufficient for example for a freelancer wanting to monitor his sites (a single l4n-dashboard can connect to multiple log-sources).
FaktNet has various licenses, depending on how many users are supposed to be able to access the dashboard, and their Enterprise license isn't really expensive (it's $600 I think). Given its ability to access multiple logs it can be a major asset to a development team that's developing and monitoring many medium to large scale websites.