With log4j2, a simple change in configuration can ensure that every time a log file is rolled over, it gets compressed for optimal use of storage space.
Default configuration:
To automatically compress the rolled over log files, update the highlighted line to:
-%i will ensure that in a rare scenario when there has been increased logging and the threshold size can be been reached more than once in the specified interval, the previously rolled over file won't get over written.
.gz will ensure that files are compressed using gzip
To understand the finer details about log4j2 appenders, you may check out the official documentation.
Similarly you can also make similar changes to llap-cli log settings: