Log rotation - input-output-hk/iohk-monitoring-framework GitHub Wiki

Configuration

A global configuration of log rotation for all katip scribes:

rotation:
  rpLogLimitBytes: 5000000
  rpKeepFilesNum:  10
  rpMaxAgeHours:   24

A single scribe may also have its specific log rotation:

  - scKind: StdoutSK
    scName: stdout
    scFormat: ScText
    scRotation: null
  - scKind: FileSK
    scFormat: ScText
    scName: "node.log"
    scRotation:
      rpLogLimitBytes: 25000000
      rpKeepFilesNum:  10
      rpMaxAgeHours:   24

Mechanism

1.) on startup, log rotation is validating that the creation date of an existing log file is not older than the rpMaxAgeHours value in configuration. If the file is more recent, then new log items are appended to this file, otherwise a new log file with a new timestamp is created.

2.) if the size of a log file is larger than the configured rpLogLimitBytes value, a new file with a new timestamp is created.

3.) if the number of log files is larger than the configuration setting rpKeepFilesNum, the oldest files in excess are deleted.