I know I'm about 4 years behind, but figuring others might be as well, I just wanted to say that I'm using log4net religiously in my applications. I'd say it "rocks", but a better explanation would be to say it does what I want it to do with little effort. If you are using a different logging library, such as Microsoft's Logging and Instrumentation Application Block, and it's doing what you need of it, then don't switch. But if you're using a library that's not working out for you, or aren't at all, go
visit the log4net homepage right now.
log4net is really flexible, and let's you output the result of warnings and errors any number of ways (called appenders). It can also be configured a number of different ways. It can be a little too much at first (and I don't find the documentation that great for someone trying to get started with it), but it's well worth the small initial investment.
For example, I use log4net in my AMF.NET project (Flash .NET Remoting). If an exception occurs in any of the three main steps, I log the exception with log4net. Anyone who downloads AMF.NET can configure log4net to work in their environment. Maybe they want the log output to be sent to MS SQL, or to an XML file, or sent by email, or just ignored. Whatever they want, they can simply configure it in their web.config and voila. You can even set it up to log info and warning level messages to MS SQL, but have error and fatal level messages emailed.
There are only a handful of things I wish they'd add (some of these are probably already there, and I just haven't figured them out). First, I wish there was some type of RSS appender. Secondly it'd be nice if I could point to other configuration sections for some of the data (ie, I hate having to store the same connectionString in multiple places of my web.config). Although I got it up and running quickly enough, I still think a more straightforward guide would be useful - maybe a future project for me :)
Posted
03-30-2006 2:32 PM
by
karl