Skip to main content

Log Rotate Configuration

The three log files, shell.stderr, shell.stdout, and kylin.out under the log directory $KYLIN_HOME/logs/ of Kylin, trigger log rolling checks regularly by default.

Caution: Any change of configurations below requires a restart to take effect.

PropertiesDescriptDefaultOptions
kylin.env.max-keep-log-file-numberMaximum number of files to keep for log rotate10
kylin.env.max-keep-log-file-threshold-mbLog files are rotated when they grow bigger than this256,whose unit is MB
kylin.env.log-rotate-check-cronThe crontab time configuration33 * * * *
kylin.env.log-rotate-enabledWhether to enable crontab to check log rotatetruefalse

Default Regularly Rotate strategy

To use the default regularly rotate strategy, you need to set the parameter kylin.env.log-rotate-enabled=true (default), and also need to ensure that users running Kylin can use the logrotate and crontab commands to add a scheduled task.

When using the rotate strategy, Kylin will add or update crontab tasks according to the kylin.env.log-rotate-check-cron parameter on startup or restart, and remove the added crontab tasks on exit.

Known Limitations

  • If the default regularly rotate policy conditions are not met, Kylin will only trigger the log rolling check at startup. Every time the kylin.sh start command is executed, according to the parameter kylin.env.max-keep-log-file-number and kylin.env.max-keep-log-file-threshold-mb for log rolling. If Kylin runs for a long time, the log file may be too large.
  • When using crontab to control log rotation, the rolling operation is implemented by the logrotate command. If the log file is too large, the log may be lost during the rotation.