views:

980

answers:

6

Hi,

i Was wondering what people are using for logging in .net. We have log4net here, but am looking to do it async and to a database with a nice viewer.

What are the popular choices??

Regards.

A: 

We simply log to the database on error because we are a heavily used OLTP system.

If the DB goes down, then the system is down: asynch logging when the phones are red hot is redundant...

gbn
there's a performance impact in sync logging, and in my case i dont want to just log errors.
mickdelaney
We just log errors so we can accept the hit
gbn
A: 

I've seen references to people having used the Microsoft Enterprise Library logging facility, in combination with MSMQ, to achieve asynchronous logging. No help on the viewer.

jlew
+1  A: 

Log4Net delivers log messages to appenders synchronously, but the appenders can behave asynchronously according to this. The SqlServerAppender has a bufferSize property that controls how many log events are collected in the buffer before they are written to the database. If that doesn't meet your needs, you could write your own appender. A reply in this post appears to give a working example.

Jamie Ide
A: 

I would highly recommend looking into NLOG. It's very flexible and logs asynchronously. You can configure it to log to a specific file or DB. However, you'll need to build your own log viewer.

We use NLOG religiously and couldn't be happier with it.

dkpatt
A: 

When we did this, we simply wrote to a simple internal queue and had a thread do the actual write. This way our code that was logging is minimally impacted, and the simple queue and thread managed keeping us up to date.

Will Hartung
A: 

Try logFaces, it's centralized log server, aggregator and viewer, works nicely with log4net UDP appender.

Dima