Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm looking for a really good and light .NET logging component.

I've used Enterprise Library and do like it but it's a bit heavy if you don't use other components in the collection.
I've recently also used BitFactory's .NET Logging Framework and like it too but am not sold on it yet.

Is there something better?

share|improve this question

closed as off topic by Mark Trapp Jan 27 '12 at 0:13

Questions on Programmers Stack Exchange are expected to relate to software development within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

    
If you can vote and think this is a useful question or it have useful answers below, please vote up. StackExchange sites need votes to build a good community. You can give 30 votes per day, don't waste them. Specially users with high reputation and low counting votes given please read this: meta.programmers.stackexchange.com/questions/393/… –  bigown Oct 5 '10 at 22:23
    
You're asking practially the same question here: programmers.stackexchange.com/questions/20109/… is there a reason to post this question twice? –  Bil Mar 24 '11 at 13:05
2  
@Bil - I didn't ask that question. I edited it. –  Walter Mar 24 '11 at 15:45
add comment

8 Answers 8

up vote 22 down vote accepted

Have you tried log4net? I have used it for a few years, and it works well.

a tool to help the programmer output log statements to a variety of output targets. In case of problems with an application, it is helpful to enable logging so that the problem can be located. With log4net it is possible to enable logging at runtime without modifying the application binary. The log4net package is designed so that log statements can remain in shipped code without incurring a high performance cost. It follows that the speed of logging (or rather not logging) is crucial.

At the same time, log output can be so voluminous that it quickly becomes overwhelming. One of the distinctive features of log4net is the notion of hierarchical loggers. Using these loggers it is possible to selectively control which log statements are output at arbitrary granularity.

log4net is designed with two distinct goals in mind: speed and flexibility...

share|improve this answer
1  
+1 Haven't had to use anything else. –  yhw42 Sep 5 '10 at 15:26
    
+1 Same here. It is a delight to use. –  Kanini Oct 29 '10 at 5:36
    
random downvote 3 years later is...random –  Joe Dec 16 '13 at 18:57
add comment

NLog is my preferred logging component. There are multiple comparisons that detail differences between log4net and NLog, but they are both very capable and mature frameworks. I'd recommend trying both of them and picking your preference. You can't go wrong with either.

share|improve this answer
1  
+1 for NLog, Feature rich and last time I checked more actively developed then log4net –  Slomojo Dec 26 '10 at 11:49
add comment

Enterprise Library has a logging application block that works well.

Personally, I don't know about frameworks but I have enjoyed building and using some AOP logging aspects in a library of mine. Nothing is easier than putting [Log] on a method to have it logged (or, almost as easy for an entire project).

share|improve this answer
add comment

If you're willing to consider a commercial product, take a look at GIBRALTAR.

  • It works with any .NET program
  • Logs exception details like ELMAH
  • Works with log4net, NLog, or own logging API.
  • Collects windows performance counters like PerfMon
  • Collects application usage metrics like PreEmptive's Runtime Intelligence Service
  • Uses PostSharp aspect-oriented program (AOP) to let you instrument your programs declaratively.
share|improve this answer
add comment

Self promotion: Loggr

Loggr is a hosted event logging service with some cool features. They have a great, fluent logging agent for .Net developers.

Loggr.Events.Create()
    .Text("Purchase 2 large pillows")
    .Tags("purchase online")
    .Source("jon.doe")
    .Value(35.50)
    .Geo(40.1203, -76.2944)
    .Post()
share|improve this answer
    
Any full source code sample application using Loggr? –  Kiquenet May 30 at 9:10
add comment

Take a look at Crypto Logger - it comes with its own log viewer app which makes it easy to analyse and mine the logs later. The logging library itself is small and effectient.

DISCLAIMER: I work for LogicNP, the developers of Crypto Logger.

share|improve this answer
add comment

Or you could declare all these logging frameworks a mugs game and just use an abstraction layer that can talk to any of them.. http://netcommon.sourceforge.net/

share|improve this answer
add comment

SmartInspect: http://www.gurock.com/smartinspect/

A great tool, and fantastic alternative for situations where remote debugging may not be available.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.