Log file in /var/log are not being compressed during log rotation
search cancel

Log file in /var/log are not being compressed during log rotation

book

Article ID: 373752

calendar_today

Updated On:

Products

VMware SDDC Manager

Issue/Introduction

  • SDDC Manager appliance partitions runs out of space due to logs being rotated but not compressed.

Environment

  • VCF 4.x
  • VCF 5.0
  • VCF 5.1.x

Cause

In some VCF versions the system logs being rotated are not compressed. As a result they take a lot of storage on the root partition and it might run out of space.

Resolution

  1. Take a snapshot of SDDC Manager appliance.
  2. Go to /etc/logrotate.conf and for each of the sections like the one below add a line "compress":

    /var/log/message {
            rotate 5
            daily
            copytruncate
     }
    example after line addition:

    /var/log/message {
            rotate 5
            daily
            copytruncate
            compress
    }
  3.  Delete uncompressed logs in /var/log to free some space, if they are not needed