Ejemplo n.º 1
0
        private static ILog GetStatisticsLogger()
        {
            RollingFileAppender roller = new RollingFileAppender();

            roller.AppendToFile       = true;
            roller.RollingStyle       = RollingFileAppender.RollingMode.Size;
            roller.MaxSizeRollBackups = 10;
            roller.MaximumFileSize    = "10MB";
            roller.File = $@"logs\{System.Reflection.Assembly.GetEntryAssembly().GetName().Name}_statistics.log";

            roller.StaticLogFileName = true;
            roller.Layout            = new PatternLayout("%d{yyMMdd HH:mm:ss.fff} %-5p : %m%n");
            roller.LockingModel      = new FileAppender.MinimalLock();
            roller.ActivateOptions();

            DummyLogger dummyILogger = new DummyLogger("AppLogEx");

            // 요걸 연결안해주면 log4net 안에서 Null참조 예외가 발생한다.
            dummyILogger.Hierarchy = (log4net.Repository.Hierarchy.Hierarchy)LogManager.GetRepository();
            dummyILogger.Level     = log4net.Core.Level.Info;
            dummyILogger.AddAppender(roller);

            return(new NSLogStatistics(dummyILogger));
        }
Ejemplo n.º 2
0
 public NSLogStatistics(DummyLogger log) : base(log)
 {
 }
Ejemplo n.º 3
0
 public NSLogEx(DummyLogger log) : base(log)
 {
 }