Trace and LogForNet

C

Champika Nirosh

Hi,

What is the different between System.Diagnostic.Trace and LogforNet..
if Trace is there to track error why this open source library is there..

Please clarify..

Nirosh.
 
I

Ian Griffiths [C# MVP]

Log4Net (I assume that's what you mean by LogForNet) provides much more
fine-grained control over logging. It is very much easier to turn logging
for individual components on and off with Log4Net. Log4Net also ships with
a wide range of log output handlers - you can have it write to text files on
a rotating basis, or a new text file for each day, or you can send output to
the system event log... Or you can plug in your own 'appender' to write the
output somewhere else entirely.

You can do a fair amount of this with System.Diagnostic.Trace too, it just
takes about 100 times as much effort. And you usually end up writing a
wrapper for it to get the flexibility you require. And at that point, it
doesn't seem to offer a lot.

On the projects where I've used log4net, it has made it very easy to do
logging configurations that would have taken ages to get working with the
basic Trace class.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top