// Collection of code snippets by Arne Vajhøj // (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) using System; using NLog; namespace Logging.NLog { public class Test { private static readonly Logger log = LogManager.GetCurrentClassLogger(); public static int Fac(int n) { int res; if (n <= 1) { res = 1; } else { res = n * Fac(n - 1); } if(log.IsDebugEnabled) { log.Debug("fac : n = " + n + " res = " + res); } return res; } public static void Main(string[] args) { log.Info("Start"); Console.WriteLine(Fac(50)); log.Info("End"); } } }