01-09-2018 04:43 AM
Hi all,
How can i setup logrotate for jcc_output.log ?
in this moment this log is very big on all snaplogic servers ( 60 GB ) and i need to know how can i configure logrotate for these logs.
Best regards,
Petrica
Solved! Go to Solution.
01-09-2018 11:29 PM
The logs which are written to by the JCC are automatically rotated as required. The log settings are configurable in the Snaplex properties.
jcc_output.log is the stdout of the JCC process, not much output goes to the stdout usually and it is not automatically rotated. To enable log rotation for the stdout, ensure logrotate is configured on the machine and then create the file /etc/logrotate.d/jcc
with the contents
/opt/snaplogic/run/log/jcc_output.log /opt/snaplogic/run/log/monitor.log {
copytruncate
compress
size 100M
rotate 10
notifempty
}
To verify the logrotate configuration, run
sudo logrotate -vf /etc/logrotate.d/jcc
If the existing log is large, the first rotation can be slow because of the file copy required. To manually truncate the log file before enabling logrotate, do
sudo truncate -s 0 /opt/snaplogic/run/log/jcc_output.log
01-09-2018 11:29 PM
The logs which are written to by the JCC are automatically rotated as required. The log settings are configurable in the Snaplex properties.
jcc_output.log is the stdout of the JCC process, not much output goes to the stdout usually and it is not automatically rotated. To enable log rotation for the stdout, ensure logrotate is configured on the machine and then create the file /etc/logrotate.d/jcc
with the contents
/opt/snaplogic/run/log/jcc_output.log /opt/snaplogic/run/log/monitor.log {
copytruncate
compress
size 100M
rotate 10
notifempty
}
To verify the logrotate configuration, run
sudo logrotate -vf /etc/logrotate.d/jcc
If the existing log is large, the first rotation can be slow because of the file copy required. To manually truncate the log file before enabling logrotate, do
sudo truncate -s 0 /opt/snaplogic/run/log/jcc_output.log
02-07-2018 01:04 AM
Hi Akidave,
Thank you for your help on this.
This worked like a charm. 🙂
Best regards,
Petrica
08-20-2019 03:02 AM
where does the file gets archived after rotation?
08-20-2019 01:31 PM
Regular logs are backed up into the $SL_ROOT/run/log/backup folder https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1439068/Configuration+Options#Configuratio....
The stdout being rotated using logrotate configuration specified above will get backed up to files like /opt/snaplogic/run/log/jcc_output.log.1.gz, /opt/snaplogic/run/log/jcc_output.log.2.gz etc