Skip to main content
Version: 5.0.0

Log Rotate

Log Rotation Configuration

Kylin's log rotation is configured to manage the three log files: shell.stderr, shell.stdout, and kylin.out located in the $KYLIN_HOME/logs/ directory. Any changes to the configurations below require a restart to take effect.

PropertyDescriptionDefault ValueOptions
kylin.env.max-keep-log-file-numberMaximum number of log files to keep10
kylin.env.max-keep-log-file-threshold-mbLog file rotation threshold (in MB)256
kylin.env.log-rotate-check-cronCrontab time configuration for log rotation33 * * * *
kylin.env.log-rotate-enabledEnable log rotation using crontabtruefalse

Default Log Rotation Strategy

To use the default log rotation strategy:

  1. Set kylin.env.log-rotate-enabled to true (default).
  2. Ensure users running Kylin can use the logrotate and crontab commands to add a scheduled task.

Kylin will:

  • Add or update crontab tasks according to kylin.env.log-rotate-check-cron on startup or restart.
  • Remove added crontab tasks on exit.

Known Limitations

  • If the default log rotation policy conditions are not met, Kylin will only perform log rolling checks at startup. This means that log files will be rotated based on the kylin.env.max-keep-log-file-number and kylin.env.max-keep-log-file-threshold-mb parameters every time the kylin.sh start command is executed. Note that prolonged Kylin runtime may result in excessively large log files.
  • Using crontab to control log rotation may result in log loss during rotation if the log file is too large.