protected override void post()
        {
            base.post();
            Logger root     = Logger.getRootLogger();
            var    fileName = Path.Combine(getProperty("application.support.path"),
                                           getProperty("application.name").ToLower().Replace(" ", "") + ".log");
            RollingFileAppender appender = new RollingFileAppender(new PatternLayout(@"%d [%t] %-5p %c - %m%n"),
                                                                   fileName, true);

            appender.setEncoding("UTF-8");
            appender.setMaxFileSize("10MB");
            appender.setMaxBackupIndex(0);
            root.addAppender(appender);
            if (Debugger.IsAttached)
            {
                root.setLevel(Level.DEBUG);
            }
        }
Beispiel #2
0
        protected override void configureLogging(String level)
        {
            base.configureLogging(level);

            Logger root     = Logger.getRootLogger();
            var    fileName = Path.Combine(LogDirectoryFinderFactory.get().find().getAbsolute(),
                                           getProperty("application.name").ToLower().Replace(" ", "") + ".log");
            RollingFileAppender appender = new RollingFileAppender(new PatternLayout(@"%d [%t] %-5p %c - %m%n"),
                                                                   fileName, true);

            appender.setEncoding("UTF-8");
            appender.setMaxFileSize(Level.DEBUG.ToString().Equals(level) ? "250MB" : "10MB");
            appender.setMaxBackupIndex(0);
            root.addAppender(appender);
            if (Debugger.IsAttached)
            {
                root.setLevel(Level.DEBUG);
            }
        }