cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

How can i setup logrotate for jcc_output.log?

Petrica
New Contributor II

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

1 ACCEPTED SOLUTION

akidave
Employee
Employee

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

View solution in original post

4 REPLIES 4

akidave
Employee
Employee

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

Petrica
New Contributor II

Hi Akidave,

Thank you for your help on this.
This worked like a charm. ๐Ÿ™‚

Best regards,
Petrica

Komal
New Contributor

where does the file gets archived after rotation?

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