Ejemplo n.º 1
0
        public static ILog ConfigureFileAppender(this ILog log, String file)
        {
            var appender = new FileAppender();

            appender.Layout = ILogExtensions.PatternLayout;
            appender.File   = file;
            appender.ActivateOptions();

            log.AddAppender(appender);

            return(log);
        }
Ejemplo n.º 2
0
        public static ILog ConfigureManagedColoredConsoleAppender(this ILog log, params ManagedColoredConsoleAppender.LevelColors[] mapping)
        {
            var appender = new ManagedColoredConsoleAppender();

            appender.Layout = ILogExtensions.PatternLayout;
            mapping.ForEach(m => appender.AddMapping(m));
            appender.ActivateOptions();

            log.AddAppender(appender);

            return(log);
        }