Interface LogRuntimeConfig.FileConfig.RotationConfig

Enclosing interface:
LogRuntimeConfig.FileConfig

public static interface LogRuntimeConfig.FileConfig.RotationConfig
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Whether log rotation is enabled.
    The file handler rotation file suffix.
    int
    The maximum number of backups to keep.
    The maximum log file size, after which a rotation is executed, up to Long.MAX_VALUE bytes.
    boolean
    Indicates whether to rotate log files on server initialization.
  • Method Details

    • enabled

      @WithDefault("true") boolean enabled()
      Whether log rotation is enabled.
    • maxFileSize

      @WithDefault("10M") @WithConverter(MemorySizeConverter.class) @WithConverter(MemorySizeConverter.class) MemorySize maxFileSize()
      The maximum log file size, after which a rotation is executed, up to Long.MAX_VALUE bytes. Note that the file is rotated after the log record is written. Thus, this isn't a hard maximum on the file size; rather, it's a hard minimum on the size of the file before it is rotated.
    • maxBackupIndex

      @WithDefault("5") int maxBackupIndex()
      The maximum number of backups to keep.
    • fileSuffix

      Optional<String> fileSuffix()
      The file handler rotation file suffix. When used, the file will be rotated based on its suffix.

      The suffix must be in a date-time format that is understood by DateTimeFormatter.

      Example fileSuffix: .yyyy-MM-dd

      Note: If the suffix ends with .zip or .gz, the rotation file will also be compressed.

    • rotateOnBoot

      @WithDefault("true") boolean rotateOnBoot()
      Indicates whether to rotate log files on server initialization.

      You need to either set a max-file-size or configure a file-suffix for it to work.