We’re evaluating log4net for both general purpose logging and for managing an audit log that will be visible to non-technical users.  We have a need to log three types of audit events:

 

  • Success – Operation completed successfully
  • Soft Failure – Operation failed but will be retried
  • Hard Failure – Operation permanently failed and will not be retried.

 

We think we understand how to implement this within the log4net framework, but since this seems like a common problem I thought we would post to see if there are any best practices.

 

Our current thoughts are to:

 

  • Add three custom levels: Success, SoftFail, HardFail just above Error in priority.
  • Log audit messages within the context of other debugging messages via the “standard” root appender model.
  • Add a separate “audit message only” appender that filters out events below the audit message priority to create a log suitable for display (possibly after massaging) to customers.

 

Thoughts?

 

Best,

Bob Pinna

http://www.marketvoyce.com

 

 

Reply via email to