views:

549

answers:

4

We are currently using the log4net appender (web.config snippet):

<appender name="FileAppender" type="log4net.Appender.RollingFileAppender">

Looking for experience using other appenders.

+2  A: 

We use SmtpAppender for ERROR and FATAL levels to "mail home" exception reports. Also ConsoleAppender when running a Windows Service in a console.

For FileAppender we set <staticLogFileName value="false" /> to avoid an ever-increasing delay when rolling over to a new file and the folder contains lots of files.

devstuff
@devstuff: Good answer +1
Kb
@Mun's answer was more accurate than mine - we're actually using the RollingFileAppender and ColoredConsoleAppender too. The staticLogFileName is part of RollingFileAppender.
devstuff
+2  A: 

We're also using the SmtpAppender to log fatal errors and send back the exception reports, though this is used in conjunction with a custom error handler, which also sends an email with a bit more information such as page url, session variables, request values, etc (as the SmtpAppender only sends some of the log and the exception details).

For file-based logging, we're using the RollingFileAppender, and having it generate a new log file for each day, to avoid ending up with huge log files.

For console applications, we're using the ColoredConsoleAppender.

I've seen some web applications using the AdoNetAppender, but avoid using it personally as I'm not sure how good the performance would be, though it could be a good idea to log error and fatal messages to the database (which would be less often than debug messages).

Mun
+2  A: 

My former company actually found that NLog was faster.

Bill
+1  A: 

I am looking for a way to limit SmtpAppender to limit number of emails sent in case of same error is occurred multiple times in a defined time span.

I don't know if it is even possible, any help will be appreciated