Set Up Log Rotation
When logging to a file, FeatureBase components will re-open the log file on receipt of the HUP signal. This allows for seamless log rotation. As an example, to configure log rotation with FeatureBase:
-
First create a log directory owned by the system user that runs the FeatureBase process; we recommend
/var/log/molecula
. -
Next, configure FeatureBase to write to a file in that new directory. Edit your featurebase.conf and add
log-path = "/var/log/molecula/featurebase.log"
. -
Restart FeatureBase for the new logging configuration to take effect.
-
Ensure that logrotate is installed and configured to run daily with cron. This should be the default after installation on most Linux systems. Check
/etc/cron.daily/logrotate
to make sure. -
Add a new logrotate configuration file at
/etc/logrotate.d/featurebase
with the following contents:
/var/log/molecula/featurebase.log {
missingok
notifempty
rotate 7
daily
compress
postrotate
pkill -HUP featurebase
endscript
}
- Repeat steps 2-5 for the Ingesters, replacing references to FeatureBase where appropriate.
Note that pkill -HUP featurebase
may not be reliable and that you should use kill -HUP $(cat /path/to/pidfile)
if you are using a PID file.