Tuesday, December 9, 2008

Logging guidelines

INFO Level

  • The start and end of the method
  • The start and end of any major loops
  • The start of any major case/switch statements

DEBUG Level

  • Any parameters passed into the method
  • Any row counts from result sets I retrieve
  • Any datarows that may contain suspicious data when being passed down to the method
  • Any "generated" file paths, connection strings, or other values that could get mungled up when being "pieced together" by the environment.

ERROR Level

  • Handled exceptions
  • Invalid login attempts (if security is an issue)
  • Bad data that I have intercepted forreporting

FATAL Level

  • Unhandled exceptions.