Log4net

From Richard's Wiki
Revision as of 21:21, 14 September 2011 by Rkdrm (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
  • Declare a Logger without explicitly naming the calling type (use reflection):
using System.Reflection;
private readonly ILog _log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config", Watch = true)]