This feature is already a part of Cloverleaf.
I’m not sure what version of Cloverleaf it appeared in.
Go to your site directory and look at a file called siteInfo.
At the bottom of the file it mentions LogHistory.
This enables process logs as well as hcimonitord logs to be saved.
You need to bounce after making changes.
Mine is configured as follows:
######################################################################
# LogHistory Feature Configurable Options.
# change these values unless you are sure of what you are doing.
######################################################################
# LogHistoryEnabled – The number identifying if LogHistory feature is
# enabled for this site, and this is applied to scope of site,
# engine and monitord log are included.
# 0 : LogHistory feature is disabled. This is also
# the value by default.
# 1 : LogHistory feature is enabled.
LogHistoryEnabled=1
# LogHistoryMaxLogFiles – The number identifying the maximum number of backed-up
# log files which cloverleaf keeps if LogHistoryEnabled=1.
# This is applied to engine and monitord log.
#
# 0 : maximum number is unlimited, 0 is
# also the value by default. It means unlimited.
# x (x>0): the maximum number is set.
LogHistoryMaxLogFiles=7
# LogHistoryMaxDiskUse – The number identifying the maximum size (in KB) of total
# backed-up log files which cloverleaf keeps if LogHistoryEnabled=1.
# This is applied to engine and monitord log.
#
# 0 : maximum size is unlimited, 0 is
# also the value by default. It means unlimited.
# x (x>0): the maximum size is set.
LogHistoryMaxDiskUse=0
#LogHistoryCompressCommand – The string value identifying the command to
# compress the backed-up log files to save the disk space.
#
# The value of this option is the executable name to compress
# the backed-up log files. By default it is set to NULL, compressing
# is disabled. gzip and compress command is supported.
# For example: LogHistoryCompressCommand=gzip
LogHistoryCompressCommand=NULL