Class RotatingFileTarget

    • Field Detail

      • m_append

        private boolean m_append
    • Constructor Detail

      • RotatingFileTarget

        public RotatingFileTarget​(Formatter formatter,
                                  RotateStrategy rotateStrategy,
                                  FileStrategy fileStrategy)
                           throws java.io.IOException
        Construct RotatingFileTarget object.
        Parameters:
        formatter - Formatter to be used
        rotateStrategy - RotateStrategy to be used
        fileStrategy - FileStrategy to be used
        Throws:
        java.io.IOException - if a file access or write related error occurs
      • RotatingFileTarget

        public RotatingFileTarget​(boolean append,
                                  Formatter formatter,
                                  RotateStrategy rotateStrategy,
                                  FileStrategy fileStrategy)
                           throws java.io.IOException
        Construct RotatingFileTarget object.
        Parameters:
        append - true if file is to be appended to, false otherwise
        formatter - Formatter to be used
        rotateStrategy - RotateStrategy to be used
        fileStrategy - FileStrategy to be used
        Throws:
        java.io.IOException - if a file access or write related error occurs
    • Method Detail

      • rotate

        protected void rotate()
                       throws java.io.IOException
        Rotates the file.
        Throws:
        java.io.IOException - if a file access or write related error occurs
      • write

        protected void write​(java.lang.String data)
        Output the log message, and check if rotation is needed.
        Overrides:
        write in class StreamTarget
        Parameters:
        data - the date to write to the target