Class SizeRotatingFileAuditEndpoint

    • Field Detail

      • rotateSize

        private final long rotateSize
      • maxBackupIndex

        private final int maxBackupIndex
      • rotateOnBoot

        private final boolean rotateOnBoot
      • currentSize

        private long currentSize
      • suffix

        private final String suffix
    • Method Detail

      • write

        protected void write​(byte[] bytes)
                      throws IOException
        Description copied from class: FileAuditEndpoint
        Method called to write given byte array to the target local file. This method can be overridden by subclasses to modify data written into file (to encrypt them for example), or just for counting amount of written bytes for needs of log rotation and similar. This method can be invoked only in synchronization block surrounding one log message processing.
        Overrides:
        write in class FileAuditEndpoint
        Parameters:
        bytes - the data to be written into the target local file
        Throws:
        IOException
      • preWrite

        protected void preWrite​(Instant instant)
        Description copied from class: FileAuditEndpoint
        Method called before writing into local file. This method is NO-OP by default. It is intended to be overridden by subclasses which need to perform some operation before every writing into the target local file. This method can be invoked only in synchronization block surrounding one log message processing.
        Overrides:
        preWrite in class FileAuditEndpoint
        Parameters:
        instant - time of the message acceptance
      • rotate

        private void rotate​(File file)
                     throws IOException
        Moves file to file.1, file.1 to file.2 etc. Removes file.{maxBackupIndex}
        Throws:
        IOException