示例#1
0
        public static IControlledLogTrace SpanContext(this IControlledLogTrace ext)
        {
            if (ExecutionControlManager.Current != null)
            {
                foreach (string key in ExecutionControlManager.Current.GetCtxKeys())
                {
                    ext.AddProperty($"remote-{key}", ExecutionControlManager.Current.GetCtxValue(key));
                }
            }

            return(ext);
        }
示例#2
0
        public void TestMethod4()
        {
            using (ILoggingOperation op = LogManager.GetLogger("Test4").NormalOperation())
            {
                using (IControlledLogTrace tr = op.TraceStart())
                {
                    Assert.IsTrue(true);
                }
                using (IControlledLogTrace tr = op.TraceStart())
                {
                    Assert.IsTrue(true);
                }

                using (IControlledLogTrace tr = op.TraceStart())
                {
                    Assert.IsTrue(true);
                    throw new Exception("xy");
                }
            }
        }