You may need to do log management for your Anaconda Enterprise Repository or Anaconda Enterprise Notebooks installation. Log files may grow to large sizes and takes the required disk space on your server.
There are no configurable options to change the software logs but you can manage log size and storage on daily, weekly or monthly interval using logrotate, a Linux utility program available on many Linux systems.
Logrotate allows you to rotate out log file on a timed interval or when files reach a certain size. Logrotate can then compress the log files to save space and remove the oldest log archive after a certain amount of archived logs are reached.
Log directories
AE-Notebooks has three log directories:
- Server:
/opt/wakari/wakari-server/var/log/wakari/
- Gateway:
/opt/wakari/wakari-gateway/var/log/wakari/
- Compute:
/opt/wakari/wakari-compute/var/log/wakari/
AE-Repository has one log directory: /home/anaconda-server/repo/var/log/anaconda-server/
The directory paths are used when creating a Logrotate configuration file for the service.
Here is an example Lograte file:
/opt/wakari/wakari-gateway/var/log/wakari/*.log
{
rotate 5
daily
size 50M
compress
dateext
missingok
notifempty
postrotate
/sbin/service wakari-gateway restart
endscript
}
It can be placed in /etc/lograte.d/
. In this directory you can create a file with the name of the service you are rotating logs for wakari-server, wakari-gateway, wakari-compute and anaconda-server.
Directives which may be included in a logrotate configuration file:
- rotate command determines how many archived logs are returned before logrotate start deleting the older ones.
- daily command instructs Logrotate how often to rotate a particular log - daily, weekly, monthly or yearly.
- size command specifies how large the file should be before rotating. It overrides daily or other intervals.
- compress command archive the log files to be compressed in gzip format.
- dateext rotates the old log file with date in the log filename.
- missingok command will not return an error if log file is missing.
- notifempty command is to not rotate if the file is empty.
Also see the other configuration options to tailor your log archiving needs.