• Cloud Container Engine

cce
  1. Help Center
  2. Cloud Container Engine
  3. User Guide
  4. FAQs
  5. How to Set the Log Policy for a Kubernetes Component?

How to Set the Log Policy for a Kubernetes Component?

Currently, CCE uses logrotate to rotate logs. The configuration path of logrotate is /etc/logrotate.d/. Go to the path to modify the configuration file for the target component.

NOTE:

For example, if you delete the hourly row, logs will be rotated by log size only.

Example configuration:

/var/paas/sys/log/kubernetes/kube-apiserver.log {
    rotate 5                              \\Five log files are retained.
    copytruncate
    missingok
    notifempty
    compress
    maxsize 100M                           \\The maximum size of a log file is 100 MB.
    hourly                                 \\Logs are rotated every hour.
    create 0640 root root
}