Disclaimer:

All content provided in these articles is for informational purposes only.

Amitego gives no support or warranty for the accuracy or completeness of any information in these articles or found by following any link on this site.

 

 

This is a cookbook to adjust and configure log rotation in SGD5.20 and VISULOX 3.

 

SGD Service Log Rotation

 
By default, SGD archives its log files each week at 3 a.m. on Sunday, using a cron job.

You can use the "tarantella setup" command to change the time and day that the archiving takes place.

If once a week suits best no further changes are necessary in the configuration

 

 

SGD Apache Log Rotation

Apache log rotation can be setup with logrotate.d:

 

vi ./logrotate.d/sgd_apache

/opt/tarantella/webserver/apache/*/logs/*_log {
    copytruncate
    daily
    dateext
    rotate 25
    compress
    missingok
    size=+20M
    }

What does this configuration do:

  • Specify the path to the log file.
  • copytruncate – Creates a copy of the log file and then truncates the original to an empty file so that the service can keep on logging uninterrupted.
  • daily – Performs the truncation once a day.
  • dateext – Add the date to the filename of the archived log file.
  • rotate 25 – Keep only 25 rotated log files. You can specify how many rotated logfiles suits best
  • compress – Create a gzip compressed file of the old log.
  • missingok – Suppresses error messages if the file does not exist.
  • size=+20M – Logrotate will only run when the file is 20MB or more in size. You can specify how big catalina.out suits you best.

On Oracle Linux you will find /etc/cron.daily/logrotate, which will run daily. It executes /usr/sbin/logrotate etc/logrotate.conf, which in turn will run the Apache rotation file you have added to /etc/logrotate.d/.

During patching the Apache Version in SGD can change. This is reason to address version field to the logs with an asterix.

 

 

SGD Tomcat Log Rotation


catalina.out by default does not rotate. It can grow till you run out of space.

To avoid this you can set up a log rotation with logrotate.d:

 

vi ./logrotate.d/tomcat

/opt/tarantella/webserver/tomcat/*/logs/catalina.out {
    copytruncate
    daily
    dateext
    rotate 25
    compress
    missingok
    size=+20M
    }

 
What does this configuration do:
  • Specify the path to the log file.
  • copytruncate – Creates a copy of the log file and then truncates the original to an empty file so that the service can keep on logging uninterrupted.
  • daily – Performs the truncation once a day.
  • dateext – Add the date to the filename of the archived log file.
  • rotate 25 – Keep only 25 rotated log files. You can specify how many rotated logfiles suits best
  • compress – Create a gzip compressed file of the old log.
  • missingok – Suppresses error messages if the file does not exist.
  • size=+20M – Logrotate will only run when the file is 20MB or more in size. You can specify how big catalina.out suits you best.

On Oracle Linux you will find /etc/cron.daily/logrotate, which will run daily. It executes /usr/sbin/logrotate etc/logrotate.conf, which in turn will run the Tomcat rotation file you have added to /etc/logrotate.d/.

During patching the Tomcat version in SGD can change. This is reason to address version field to the logs with an asterix.

 

 

SGD Gateway Routing Proxy (Java)

Routing proxy rotation can be setup with logrotate.d:

 

vi ./logrotate.d/routing_proxy

/opt/SUNWsgdg/proxy/var/log/*.log {
    copytruncate
    daily
    dateext
    rotate 25
    compress
    missingok
    size=+20M
    }

 

What does this configuration do:

  • Specify the path to the log file.
  • copytruncate – Creates a copy of the log file and then truncates the original to an empty file so that the service can keep on logging uninterrupted.
  • daily – Performs the truncation once a day.
  • dateext – Add the date to the filename of the archived log file.
  • rotate 25 – Keep only 25 rotated log files. You can specify how many rotated logfiles suits best
  • compress – Create a gzip compressed file of the old log.
  • missingok – Suppresses error messages if the file does not exist.
  • size=+20M – Logrotate will only run when the file is 20MB or more in size. You can specify how big catalina.out suits you best.

On Oracle Linux you will find /etc/cron.daily/logrotate, which will run daily. It executes /usr/sbin/logrotate etc/logrotate.conf, which in turn will run the Routing Proxy rotation file you have added to /etc/logrotate.d/.

 

 

SGD Gateway Reverse Proxy (Apache)

Apache log ratation can be setup with logrotate.d:

 

vi ./logrotate.d/reverse_proxy

/opt/SUNWsgdg/httpd/*/logs/*_log {
    copytruncate
    daily
    dateext
    rotate 25
    compress
    missingok
    size=+20M
    }
 
What does this configuration do:
  • Specify the path to the log file.
  • copytruncate – Creates a copy of the log file and then truncates the original to an empty file so that the service can keep on logging uninterrupted.
  • daily – Performs the truncation once a day.
  • dateext – Add the date to the filename of the archived log file.
  • rotate 25 – Keep only 25 rotated log files. You can specify how many rotated logfiles suits best
  • compress – Create a gzip compressed file of the old log.
  • missingok – Suppresses error messages if the file does not exist.
  • size=+20M – Logrotate will only run when the file is 20MB or more in size. You can specify how big catalina.out suits you best.

On Oracle Linux you will find /etc/cron.daily/logrotate, which will run daily. It executes /usr/sbin/logrotate etc/logrotate.conf, which in turn will run the Reverse Proxy rotation file you have added to /etc/logrotate.d/.

During patching the Apache Version in SGD gateway can change. This is reason to address version field to the logs with an asterix.

 

 

Visulox Log Rotation

 
During setup, a log rotation entry for VISULOX is added: /etc/logrotate.d/visulox

/opt/visulox/var/log/*.log /opt/visulox/var/users/*/log/*.log {
   compress
   daily
   rotate 9
   size=+512k
   notifempty
   missingok
   copytruncate
}
 
What does this configuration do:
  • Specify the path to the log file.
  • copytruncate – Creates a copy of the log file and then truncates the original to an empty file so that the service can keep on logging uninterrupted.
  • daily – Performs the truncation once a day.
  • dateext – Add the date to the filename of the archived log file.
  • rotate 9 – Keep only 9 rotated log files.
  • compress – Create a gzip compressed file of the old log.
  • missingok – Suppresses error messages if the file does not exist.
  • size=+512k – Logrotate will only run when the file is 512k or more in size.

On Oracle Linux you will find /etc/cron.daily/logrotate, which will run daily. It executes /usr/sbin/logrotate etc/logrotate.conf, which in turn will run the VISULOX rotation file VISULOX setup has added to /etc/logrotate.d/.

No further configurations are needed for VISULOX log rotation for all configuration has been done during setup

 

 

 

 

Copyright © VISULOX