Class MaprfsDailyRollingLogAppender

  • All Implemented Interfaces:
    java.io.Flushable, org.apache.hadoop.fs.Syncable, org.apache.log4j.Appender, org.apache.log4j.spi.OptionHandler

    public class MaprfsDailyRollingLogAppender
    extends MaprfsLogAppender
    DailyRollingLogAppender for MapRFS - majority of functionality is from DailyRollingFileAppender with enhanced asynch. handling of old files removal
    • Constructor Detail

      • MaprfsDailyRollingLogAppender

        public MaprfsDailyRollingLogAppender()
      • MaprfsDailyRollingLogAppender

        public MaprfsDailyRollingLogAppender​(java.net.URI uri,
                                             java.lang.String datePattern)
    • Method Detail

      • setDatePattern

        public void setDatePattern​(java.lang.String pattern)
        The DatePattern takes a string in the same format as expected by SimpleDateFormat. This options determines the rollover schedule.
      • getDatePattern

        public java.lang.String getDatePattern()
        Returns the value of the DatePattern option.
      • setMaxBackupIndex

        public void setMaxBackupIndex​(int maxBackups)
      • getMaxBackupIndex

        public int getMaxBackupIndex()
      • activateOptions

        public void activateOptions()
        Specified by:
        activateOptions in interface org.apache.log4j.spi.OptionHandler
        Overrides:
        activateOptions in class MaprfsLogAppender
      • append

        protected void append​(org.apache.log4j.spi.LoggingEvent event)
        This method differentiates DailyRollingFileAppender from its super class.

        Before actually logging, this method will check whether it is time to do a rollover. If it is, it will schedule the next rollover time and then rollover.

        Overrides:
        append in class MaprfsLogAppender