This is a mirror of official site: http://jasper-net.blogspot.com/

log4net tutorial pt 1: getting started

| Tuesday, August 10, 2010
I've found logging to be one of the most effective debugging and troubleshooting techniques in my engineering bag, but I'm surprised at how infrequently other people seem to use it.  The arguments orbit around the notion that adding any form of logging won't be that helpful, or that it will slow the application to a crawl.  My experience with application logging has been very positive, and quite frankly I would be a lot less effective without it.

This post is the first in a series aimed at making you comfortable and confident in using log4net as an application logging layer in your .NET applications.  Seriously, it'll make your life a lot easier.

About log4net

My logging layer of choice for .NET is log4net from the Apache Software Foundation.  It's open source, well-documented, extensible, and comes ripe with features right off the vine.  There are alternative logging platforms available if open source isn't an option for you, such as the Microsoft Logging Application Block or, if you're willing to fork out some cash, LucidLog.Net; I can't comment on them directly as I have no experience with either - I've heard good things, but I've also heard that log4net is more feature-rich that both of these.

Note: This series of posts references log4net version 1.2.10.

Getting log4net

log4net is available here as a zip archive.

The archive contains a ton of stuff; for posterity, here are some hilites of what you'll find in there:
\bin houses the log4net binaries.  The distribution contains versions of log4net built for specific platforms of .NET, including Microsoft .NET, Mono, Rotor, and the Compact Framework.
\doc contains the log4net documentation.  Open index.html to start your perusing.
\examples contains several small, digestible sample logging applications in various languages and platforms.

Read more: beefycode.com

Posted via email from .NET Info

0 comments: