Class TCRollingFileAppender

  • All Implemented Interfaces:
    org.apache.log4j.Appender, org.apache.log4j.spi.OptionHandler

    public class TCRollingFileAppender
    extends org.apache.log4j.RollingFileAppender
    Differs from RollingFileAppender in that it creates file when append action is called, not when file is set Also have ability to rotate on day change
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static TCLogStatistic STATISTIC  
      • Fields inherited from class org.apache.log4j.RollingFileAppender

        maxBackupIndex, maxFileSize
      • Fields inherited from class org.apache.log4j.FileAppender

        bufferedIO, bufferSize, fileAppend, fileName
      • Fields inherited from class org.apache.log4j.WriterAppender

        encoding, immediateFlush, qw
      • Fields inherited from class org.apache.log4j.AppenderSkeleton

        closed, errorHandler, headFilter, layout, name, tailFilter, threshold
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void append​(org.apache.log4j.spi.LoggingEvent event)  
      void rollOver()  
      void setFile​(java.lang.String fileName, boolean append, boolean bufferedIO, int bufferSize)  
      void setRotateOnDayChange​(boolean rotate)  
      void setRotateOnDayMinimalFileSize​(java.lang.String value)  
      protected void subAppend​(org.apache.log4j.spi.LoggingEvent event)  
      • Methods inherited from class org.apache.log4j.RollingFileAppender

        getMaxBackupIndex, getMaximumFileSize, setMaxBackupIndex, setMaxFileSize, setMaximumFileSize, setQWForFiles
      • Methods inherited from class org.apache.log4j.FileAppender

        activateOptions, closeFile, getAppend, getBufferedIO, getBufferSize, getFile, reset, setAppend, setBufferedIO, setBufferSize, setFile
      • Methods inherited from class org.apache.log4j.WriterAppender

        checkEntryConditions, close, closeWriter, createWriter, getEncoding, getImmediateFlush, requiresLayout, setEncoding, setErrorHandler, setImmediateFlush, setWriter, writeFooter, writeHeader
      • Methods inherited from class org.apache.log4j.AppenderSkeleton

        addFilter, clearFilters, doAppend, finalize, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, setLayout, setName, setThreshold
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TCRollingFileAppender

        public TCRollingFileAppender()
      • TCRollingFileAppender

        public TCRollingFileAppender​(@NotNull
                                     TimeService timeService,
                                     @Nullable
                                     java.lang.String statisticPeriods)
      • TCRollingFileAppender

        public TCRollingFileAppender​(org.apache.log4j.Layout layout,
                                     java.lang.String filename)
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • TCRollingFileAppender

        public TCRollingFileAppender​(org.apache.log4j.Layout layout,
                                     java.lang.String filename,
                                     boolean append)
                              throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • rollOver

        public void rollOver()
        Overrides:
        rollOver in class org.apache.log4j.RollingFileAppender
      • append

        public void append​(org.apache.log4j.spi.LoggingEvent event)
        Overrides:
        append in class org.apache.log4j.WriterAppender
      • setFile

        public void setFile​(java.lang.String fileName,
                            boolean append,
                            boolean bufferedIO,
                            int bufferSize)
                     throws java.io.IOException
        Overrides:
        setFile in class org.apache.log4j.RollingFileAppender
        Throws:
        java.io.IOException
      • setRotateOnDayChange

        public void setRotateOnDayChange​(boolean rotate)
      • setRotateOnDayMinimalFileSize

        public void setRotateOnDayMinimalFileSize​(java.lang.String value)
      • subAppend

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