Class MaprfsRollingLogAppender

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

    public class MaprfsRollingLogAppender
    extends MaprfsLogAppender
    RollingLogAppender for MapRFS. Majority of functionality is from RollingFileAppender
    • Field Detail

      • maxFileSize

        protected long maxFileSize
        The default maximum file size is 10MB.
      • maxBackupIndex

        protected int maxBackupIndex
        There is one backup file by default.
    • Constructor Detail

      • MaprfsRollingLogAppender

        public MaprfsRollingLogAppender()
      • MaprfsRollingLogAppender

        public MaprfsRollingLogAppender​(java.net.URI uri,
                                        long maxSize,
                                        int maxBackupIndex)
    • Method Detail

      • getMaxBackupIndex

        public int getMaxBackupIndex()
        Returns the value of the MaxBackupIndex option.
      • getMaximumFileSize

        public long getMaximumFileSize()
        Get the maximum size that the output file is allowed to reach before being rolled over to backup files.
      • setMaxBackupIndex

        public void setMaxBackupIndex​(int maxBackups)
        Set the maximum number of backup files to keep around.

        The MaxBackupIndex option determines how many backup files are kept before the oldest is erased. This option takes a positive integer value. If set to zero, then there will be no backup files and the log file will be truncated when it reaches MaxFileSize.

      • setMaximumFileSize

        public void setMaximumFileSize​(long maxFileSize)
        Set the maximum size that the output file is allowed to reach before being rolled over to backup files.

        This method is equivalent to setMaxFileSize(java.lang.String) except that it is required for differentiating the setter taking a long argument from the setter taking a String argument by the JavaBeans Introspector.

        See Also:
        setMaxFileSize(String)
      • setMaxFileSize

        public void setMaxFileSize​(java.lang.String value)
        Set the maximum size that the output file is allowed to reach before being rolled over to backup files.

        In configuration files, the MaxFileSize option takes an long integer in the range 0 - 2^63. You can specify the value with the suffixes "KB", "MB" or "GB" so that the integer is interpreted being expressed respectively in kilobytes, megabytes or gigabytes. For example, the value "10KB" will be interpreted as 10240.

      • append

        protected void append​(org.apache.log4j.spi.LoggingEvent event)
        Overrides:
        append in class MaprfsLogAppender