Configure log rotation

Configure log rotation

Fluentd uses two options to modify the log files rotation, the logrotate parameter that controls log rotation on a daily basis and the internal td_agent_log_rotate_size parameter, which sets the internal log rotation by file size and is set to 10 MB by default. If a log file exceeds this limit, the internal log rotation service of Fluentd applies the log rotation. You can modify td_agent_log_rotate_size if required.

To configure log rotation:

  1. Log in to the Salt Master node.

  2. Specify the following parameter in the cluster/<cluster_name>/init.yml file of the Reclass model:

    parameters:
      fluentd:
        agent:
          td_agent_log_rotate_size: <custom_value_in_bytes>
    
  3. Apply the following state:

    salt -C 'I@fluentd:agent' state.sls fluentd