public static void SetupMessagingScopedActionStream()
            {
                var auditProxy = StaticLogRepository.GetProxy(LogManager.STREAM_TOKEN_AUDIT);

                // NOTE: For best performance, only use a single scoped action for all scoped behaviors, and inject it somewhere appropriate in the middle of your stack instead of into the proxy
                auditProxy.Add(new ScopedActionLogStream(
                                   (lt, parameters) => LogManager.Logs.Audit(lt, m => m("Create log scope in {0}", lt.Name)),
                                   (lt, parameters) => LogManager.Logs.Audit(lt, m => m("Terminate log scope in {0}", lt.Name)),
                                   new NullLogStream()
                                   ));
            }
        public void Dispose()
        {
            StaticLogRepository.GetProxy(LogManager.STREAM_TOKEN_ALERT).Remove(_error);
            StaticLogRepository.GetProxy(LogManager.STREAM_TOKEN_ERROR).Remove(_error);
            StaticLogRepository.GetProxy(LogManager.STREAM_TOKEN_WARNING).Remove(_warning);
            StaticLogRepository.GetProxy(LogManager.STREAM_TOKEN_AUDIT).Remove(_info);
            StaticLogRepository.GetProxy(LogManager.STREAM_TOKEN_INFO).Remove(_verbose);
            StaticLogRepository.GetProxy(LogManager.STREAM_TOKEN_DEBUG).Remove(_debug);

            _error.Dispose(); _warning.Dispose(); _info.Dispose(); _verbose.Dispose(); _debug.Dispose();
        }
            public static void SetupContextModifyingScopedActionStream()
            {
                var auditProxy = StaticLogRepository.GetProxy(LogManager.STREAM_TOKEN_AUDIT);

                // NOTE: For best performance, only use a single scoped action for all scoped behaviors, and inject it somewhere appropriate in the middle of your stack instead of into the proxy
                auditProxy.Add(new ScopedActionLogStream(
                                   (lt, parameters) => {
                    parameters.Add(new KeyValuePair <string, object>("ScopeCreationTime", DateTime.Now.ToString()));
                },
                                   (lt, parameters) => {},
                                   new NullLogStream()
                                   ));
            }
        public PowershellLoggingInit(Cmdlet cmd)
        {
            _error   = new CmdletErrorLogStream(cmd);
            _warning = new CmdletWarningLogStream(cmd);
            _info    = new CmdletInformationLogStream(cmd);
            _verbose = new CmdletVerboseLogStream(cmd);
            _debug   = new CmdletDebugLogStream(cmd);

            StaticLogRepository.GetProxy(LogManager.STREAM_TOKEN_ALERT).Add(_error);
            StaticLogRepository.GetProxy(LogManager.STREAM_TOKEN_ERROR).Add(_error);
            StaticLogRepository.GetProxy(LogManager.STREAM_TOKEN_WARNING).Add(_warning);
            StaticLogRepository.GetProxy(LogManager.STREAM_TOKEN_AUDIT).Add(_info);
            StaticLogRepository.GetProxy(LogManager.STREAM_TOKEN_INFO).Add(_verbose);
            StaticLogRepository.GetProxy(LogManager.STREAM_TOKEN_DEBUG).Add(_debug);
        }
 public static void InitializeLogging()
 {
     StaticLogRepository.Init(ApplicationLogInitializer.LogFactoryBuilder);
     StaticLogRepository.SetTokenTransform(ApplicationLogInitializer.TransformTokens);
 }
        public ILogContextScope NewScope()
        {
            var streams = StaticLogRepository.GetTokens().Select(key => StaticLogRepository.GetRepository(key).GetLogger());

            return(NewScope(streams));
        }