Exemple #1
0
 public LogConfig(IFormatter formatter, LogCategoryRegistrar categoryRegistry = null)
 {
     Formatter         = formatter;
     CategoryRegistrar = categoryRegistry ?? new LogCategoryRegistrar();
     TargetConfigs     = new List <TargetConfig>();
     Levels            = new bool[LogLevels.Levels.Length];
 }
Exemple #2
0
        private static void InitLogger()
        {
            var categoryRegistry = new LogCategoryRegistrar();
            var formatter        = new LineFormatter(new DefaultCategoryFormatter(categoryRegistry));
            var logConfig        = new LogConfig(formatter, categoryRegistry);

            logConfig.AddTarget(LogLevel.Trace, LogLevel.Fatal, new ConsoleTarget());

            LogManager.Init(logConfig);
        }
Exemple #3
0
        private static void InitLogger()
        {
            var categoryRegistry = new LogCategoryRegistrar();
            var formatter        = new LineFormatter(new DefaultCategoryFormatter(categoryRegistry));
            var logConfig        = new LogConfig(formatter, categoryRegistry);

            logConfig.AddTarget(LogLevel.Trace, LogLevel.Fatal, new PlainTcpSocketTarget("logs6.papertrailapp.com", 26613, new SyslogFormatter("GrigoryP_Console", "Slotomania" + DateTime.Now.ToString("u"))));

            LogManager.Init(logConfig);
        }