Brian Sherwin's Blog

Moving at the Speed of .Net
posts - 98, comments - 62, trackbacks - 30

My Links

News

Twitter












Tag Cloud

Archives

Links

July 2008 Entries

When to check IsDebugEnabled when using log4net
I see this a lot in projects that I have been involved in where the code goes something like this: if (log.IsDebugEnabled) log.Debug ("Connecting to Database"); conn.Open(); or something similar when calling the other logging methods (Warn/IsWarnEnabled, Error/IsErrorEnabled, etc) Here's the point of this short post...you only need to check the log setting if what you about to do is time consuming. For example, if you are going to walk through a collection of objects and get a list of ID's that you...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Tuesday, July 15, 2008 10:43 PM | Feedback (0) |

Powered by: