BOSH agent log rotation max file size tuning
search cancel

BOSH agent log rotation max file size tuning

book

Article ID: 411592

calendar_today

Updated On:

Products

VMware Tanzu Application Service

Issue/Introduction

The following log.rotate configuration is setup by BOSH agent:

$ cat /etc/logrotate.d/vcap

# Generated by bosh-agent

/var/vcap/data/sys/log/*.log /var/vcap/data/sys/log/.*.log /var/vcap/data/sys/log/*/*.log /var/vcap/data/sys/log/*/.*.log /var/vcap/data/sys/log/*/*/*.log /var/vcap/data/sys/log/*/*/.*.log {
  missingok
  rotate 7
  compress
  copytruncate
  size=50M
}

This configuration file controls all the log rotation properties for different BOSH jobs logging on the VM.

BOSH agent has a property max_log_file_size in its internal spec.json:

cat spec.json 

{"properties":{"logging":{"max_log_file_size":""}},

 

Resolution

The BOSH agent max_log_file_size is not directly tunable via deployment manifests. The Director FILTERS the instance group fragment before passing it to the agent during apply, making this property not directly configurable.

The config file /etc/logrotate.d/vcap is editable, however does not persist through VM recreation.

Potential workarounds to this:

  1. Create a BOSH add-on that runs a pre-start script to override vcap logrotate values. 
  2. Increase the ephemeral disk size slightly for VM