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.
| Property | Description | Default Value | Options | 
|---|---|---|---|
kylin.env.max-keep-log-file-number | Maximum number of log files to keep | 10 | |
kylin.env.max-keep-log-file-threshold-mb | Log file rotation threshold (in MB) | 256 | |
kylin.env.log-rotate-check-cron | Crontab time configuration for log rotation | 33 * * * * | |
kylin.env.log-rotate-enabled | Enable log rotation using crontab | true | false | 
Default Log Rotation Strategyâ
To use the default log rotation strategy:
- Set 
kylin.env.log-rotate-enabledtotrue(default). - Ensure users running Kylin can use the 
logrotateandcrontabcommands to add a scheduled task. 
Kylin will:
- Add or update crontab tasks according to 
kylin.env.log-rotate-check-cronon 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-numberandkylin.env.max-keep-log-file-threshold-mbparameters every time thekylin.sh startcommand is executed. Note that prolonged Kylin runtime may result in excessively large log files. - Using 
crontabto control log rotation may result in log loss during rotation if the log file is too large.