Package org.apache.log4j

Examples of org.apache.log4j.RollingFileAppender


        }

        PatternLayout layout = new PatternLayout(pattern);
        layout.activateOptions();

        RollingFileAppender newAppender = null;
        try {
            newAppender = new RollingFileAppender(layout, logFile, true);
        } catch (IOException e) {
            logFatal(e, Debug.class.getName());
        }

        if (newAppender != null) {
            if (backupIdx > 0) {
                newAppender.setMaxBackupIndex(backupIdx);
            }
            if (maxSize > 0) {
                newAppender.setMaximumFileSize(maxSize);
            }
            newAppender.setThreshold(Level.DEBUG);
            newAppender.activateOptions();
            newAppender.setName(name);           
        }

        return newAppender;
    }
View Full Code Here


         * Priority is set for DEBUG becouse this implementation checks
         * log level.
         */
        logger.setPriority(Priority.DEBUG);

        RollingFileAppender appender = new RollingFileAppender( new PatternLayout( "%d - %m%n"), logfile, true);
       
        appender.setMaxBackupIndex( 1 );
       
        appender.setMaximumFileSize( 100000 );
       
        logger.addAppender(appender);
    }
View Full Code Here

        File backUpFile = File.createTempFile(file.getName() + ".", ".1." + LogFileHelper.GZIP_EXTENSION);
        _appendersFiles.put(QpidCompositeRollingAppender.class.getSimpleName(), Arrays.asList(file, backUpFile));

        FileAppender fileAppender = new FileAppender();
        DailyRollingFileAppender dailyRollingFileAppender = new DailyRollingFileAppender();
        RollingFileAppender rollingFileAppender = new RollingFileAppender();
        ExternallyRolledFileAppender externallyRolledFileAppender = new ExternallyRolledFileAppender();
        QpidCompositeRollingAppender qpidCompositeRollingAppender = new QpidCompositeRollingAppender();
        qpidCompositeRollingAppender.setbackupFilesToPath(_compositeRollingAppenderBackupFolder.getPath());

        _appenders = new ArrayList<Appender>();
View Full Code Here

         * Priority is set for DEBUG becouse this implementation checks
         * log level.
         */
        logger.setLevel(Level.DEBUG);

        appender = new RollingFileAppender( new PatternLayout( "%d - %m%n"), logfile, true);

        appender.setMaxBackupIndex( 1 );

        appender.setMaximumFileSize( 100000 );

View Full Code Here

    {
        try
        {
            // to add the appender
            PatternLayout layout = new PatternLayout("%d - %m%n");
            this.appender = new RollingFileAppender(layout, file, true);

            // if we successfully created the file appender,
            // configure it and set the logger to use only it
            appender.setMaxBackupIndex(1);
            appender.setMaximumFileSize(100000);
View Full Code Here

      file.delete();
    }
    Logger logger = ((Log4JLogger) FSNamesystem.auditLog).getLogger();
    logger.setLevel(Level.INFO);
    PatternLayout layout = new PatternLayout("%m%n");
    RollingFileAppender appender = new RollingFileAppender(layout, auditLogFile);
    logger.addAppender(appender);
  }
View Full Code Here

/**
* @version $Revision: 1.3 $ $Date: 2004/03/10 09:59:30 $
*/
public class RollingFileAppenderService extends FileAppenderService {
    public RollingFileAppenderService(ServerInfo serverInfo) {
        super(serverInfo, new RollingFileAppender());
    }
View Full Code Here

      file.delete();
    }
    Logger logger = ((Log4JLogger) FSNamesystem.auditLog).getLogger();
    logger.setLevel(Level.INFO);
    PatternLayout layout = new PatternLayout("%m%n");
    RollingFileAppender appender = new RollingFileAppender(layout, auditLogFile);
    logger.addAppender(appender);
  }
View Full Code Here

/**
* @version $Revision: 1.5 $ $Date: 2004/07/12 06:07:50 $
*/
public class RollingFileAppenderService extends FileAppenderService {
    public RollingFileAppenderService(ServerInfo serverInfo) {
        super(serverInfo, new RollingFileAppender());
    }
View Full Code Here

      file.delete();
    }
    Logger logger = ((Log4JLogger) FSNamesystem.auditLog).getLogger();
    logger.setLevel(Level.INFO);
    PatternLayout layout = new PatternLayout("%m%n");
    RollingFileAppender appender = new RollingFileAppender(layout, auditLogFile);
    logger.addAppender(appender);
  }
View Full Code Here

TOP

Related Classes of org.apache.log4j.RollingFileAppender

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.