コード例 #1
0
        private static void Operation()
        {
            using (new LogCastContext("direct log example call"))
            {
                Thread.Sleep(5);
                Log.Debug("debug");
                Thread.Sleep(10);
                Log.Info("info");
                Thread.Sleep(15);
                Log.Warn("warn");
                Thread.Sleep(20);
                Log.Error("error");
                Thread.Sleep(25);

                //adding application custom properties
                Log.AddContextProperty("my_prop", 3);
                LogCastContext.Current.Properties.Add("MY_PROP", 5);
            }
        }