예제 #1
0
        public void Configure(IConsole console)
        {
            var hierarchy = (Hierarchy)LogManager.GetRepository();
            var logger = LogManager.GetLogger(LoggerName);
            var consoleAppender = new ScriptConsoleAppender(console)
            {
                Layout = new PatternLayout(GetLogPattern(_logLevel)),
                Threshold = hierarchy.LevelMap[_logLevel.ToString().ToUpper(CultureInfo.CurrentCulture)]
            };

            hierarchy.Root.AddAppender(consoleAppender);
            hierarchy.Root.Level = Level.All;
            hierarchy.Configured = true;

            _logger = new CodeConfigurableLog4NetLogger(logger);
        }
        public void Configure(IConsole console)
        {
            var hierarchy       = (Hierarchy)LogManager.GetRepository();
            var logger          = LogManager.GetLogger(LoggerName);
            var consoleAppender = new ScriptConsoleAppender(console)
            {
                Layout    = new PatternLayout(GetLogPattern(_logLevel)),
                Threshold = hierarchy.LevelMap[_logLevel.ToString().ToUpper(CultureInfo.CurrentCulture)]
            };

            hierarchy.Root.AddAppender(consoleAppender);
            hierarchy.Root.Level = Level.All;
            hierarchy.Configured = true;

            _logger = new CodeConfigurableLog4NetLogger(logger);
        }