try...catch...finally...bloggg....: Logging Changes Logging Application Block to Log4NET

try...catch...finally...bloggg....

Wednesday, April 20, 2005

Logging Changes Logging Application Block to Log4NET

I am using Logging Application block (LAB) to do all the exception logging in my site presently. I wanted to add more info and debug statements to better help in debugging the application and to give a control flow idea to the new project members. I tried adding DEBUG level messages when entering and leaving a method. I added INFO level messages to print any parameter passed in to help in debugging. This really slowed things down considerably. I have since then evaluated log4net and I am planning to convert from LAB to Log4Net. I have some customization I did to LAB to log all the sql parameters passed to it. Now I am extending Log4Net for the same purpose. I am using version 1.2.9 and ThreadContext class provides a cool Properties map and a stack to store the additional info needed. I have additionally implemented a wrapper on the Log4Net logger class to conditionally compile out the DEBUG and INFO level messages from production release to keep the logging overhead to NIL. I am using at present the RollingFileAppender and the SMTP appender to log messages.

0 Comments:

Post a Comment

<< Home


·