How to move the log files from /var/log to a new location
If you need to move the log files from /var/log directory to a new location then follow these steps:
- Stop syslog.
Run command in terminal to stop syslog (e.g. 'systemctl stop rsyslog.service') - Edit the following file: /opt/mi/config/external/etc/rsyslog.d/metricinsights.conf
Change all occurrences of '/var/log/' to your desired destination. - Edit the following file: /app/mi/config/external/etc/logrotate.d/metricinsights
Change all occurrences of '/var/log/' to match the destination set in step #2 above. - Run the following command to move your log files and create symlinks to them:
for x in log debug error; do mv /var/log/mi.$x /my/new/location/mi.$x ln -sf /my/new/location/mi.$x /var/log/mi.$x; done -
Restart syslog.
Run command in terminal to stop syslog (e.g. 'systemctl restart rsyslog.service' or 'service rsyslog restart') - Update the LOGGING_SYSLOG_FILE_NAME config variable to reflect the new location of your log files.