The Artima Developer Community
Sponsored Link

.NET Buzz Forum
Need a logging block?

1 reply on 1 page. Most recent reply: Jun 28, 2004 10:06 AM by Jon Box

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Jon Box

Posts: 244
Nickname: jonbox
Registered: Dec, 2003

Jon Box is a .NET Developer and Regional Director.
Need a logging block? Posted: Jun 28, 2004 10:06 AM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Jon Box.
Original Post: Need a logging block?
Feed Title: Jon Box's Weblog
Feed URL: http://radio-weblogs.com/0126569/rss.xml
Feed Description: This is a log of my findings and amusements with .NET. I also present information on my presentations and others that I see.
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Jon Box
Latest Posts From Jon Box's Weblog

Advertisement

Recently, I needed a logging block for a web project that I’m on.  I initially wrote some code to log errors to the Event Log but the client changed this to also want logging to a text file.

I initially checked out PAG’s Logging Application Block and found it feature set to be very rich.  It also takes a little extra effort and has some stuff that I don’t need.  Specifically, one has to install EIF as a pre-requirement.  That just seemed a little too much if I wanted some basic logging functionality.

After asking around, I was repeatedly pointed to Log4Net.  This free library has several benefits and is easy to use.  It works for any type of .NET application and runs on multiple .NET platforms (v1.0, v1.1, .NETCF, Mono, and SSCLI v1).  It also has a variety of logging targets, a nice programmatic interface, is very configurable, and comes with lots of documentation.  I admit that I feel strange recommending a different solution when Microsoft has one, but check out this comparison between EIF and log4net.  Here is a couple of features that I like:

·        Multiple loggers active

·        Configurable, even at runtime

·        A plethora of logging targets – and some are specific to ASP.NET

·        Logger hierarchy

Here is a good article that helped me get started.  And if you’re doing ASP.NET, do not forget to add the log4net attribute to Global.ASAX.

 

 

Read: Need a logging block?


Daniel Miller

Posts: 1
Nickname: danjam
Registered: Jul, 2006

Re: Need a logging block? Posted: Jul 6, 2006 5:49 AM
Reply to this message Reply
Here's an encompassing intro to logging with log4net for ASP:

http://www.webonweboff.com/tips/asp/logging.aspx

Hope this helps...

Flat View: This topic has 1 reply on 1 page
Topic: [Development] Cryptography basics in rap music form Previous Topic   Next Topic Topic: [Blog] Welcome to Blogosphere Trisha

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use