예제 #1
0
        /// <summary>
        /// Creates the log handler for the target using the configured values.
        /// </summary>
        /// <returns>the created <see cref="LogCallHandler"/>.</returns>
        public override ICallHandler CreateHandler(IUnityContainer container)
        {
            LogCallHandler handler = new LogCallHandler();

            SetCategories(handler);
            handler.EventId           = eventId;
            handler.LogAfterCall      = logAfterCall;
            handler.LogBeforeCall     = logBeforeCall;
            handler.BeforeMessage     = beforeMessage;
            handler.AfterMessage      = afterMessage;
            handler.IncludeParameters = includeParameters;
            handler.IncludeCallStack  = includeCallStack;
            handler.IncludeCallTime   = includeCallTime;
            handler.Priority          = priority;
            handler.Severity          = severity;
            handler.Order             = Order;

            return(handler);
        }
예제 #2
0
 private void SetCategories(LogCallHandler handler)
 {
     handler.Categories.Clear();
     handler.Categories.AddRange(categories);
 }
예제 #3
0
        /// <summary>
        /// Creates the log handler for the target using the configured values.
        /// </summary>
        /// <returns>the created <see cref="LogCallHandler"/>.</returns>
        public override ICallHandler CreateHandler(IUnityContainer container)
        {
            LogCallHandler handler = new LogCallHandler();

            SetCategories(handler);
            handler.EventId = eventId;
            handler.LogAfterCall = logAfterCall;
            handler.LogBeforeCall = logBeforeCall;
            handler.BeforeMessage = beforeMessage;
            handler.AfterMessage = afterMessage;
            handler.IncludeParameters = includeParameters;
            handler.IncludeCallStack = includeCallStack;
            handler.IncludeCallTime = includeCallTime;
            handler.Priority = priority;
            handler.Severity = severity;
            handler.Order = Order;

            return handler;
        }
예제 #4
0
        LoggingTarget CreateTarget()
        {
            callHandler = new LogCallHandler();
            callHandler.LogBeforeCall = callHandler.LogAfterCall = true;
            callHandler.BeforeMessage = beforeMessage;
            callHandler.AfterMessage = afterMessage;
            callHandler.Categories.Add("General");
            callHandler.Categories.Add("PIAB");

            IUnityContainer container = new UnityContainer().AddNewExtension<Interception>();
            container.Configure<Interception>()
                .SetDefaultInterceptorFor<LoggingTarget>(new TransparentProxyInterceptor())
                .AddPolicy("Logging")
                .AddMatchingRule(new TypeMatchingRule("LoggingTarget"))
                .AddCallHandler(callHandler);

            return container.Resolve<LoggingTarget>();
        }
예제 #5
0
 private void SetCategories(LogCallHandler handler)
 {
     handler.Categories.Clear();
     handler.Categories.AddRange(categories);
 }