... | ... | @@ -65,4 +65,33 @@ Ahora, aumentamos la cantidad de rotaciones permitidas, rotando los logs por tam |
|
|
}
|
|
|
```
|
|
|
|
|
|
> Se agrega la linea ‘size 20M’ y se incrementa la cantidad de rotaciones a 30 |
|
|
\ No newline at end of file |
|
|
> Se agrega la linea ‘size 20M’ y se incrementa la cantidad de rotaciones a 30
|
|
|
|
|
|
# Logs: Apache Tomcat
|
|
|
Por defecto, logrotate configura la rotación de log de Tomcat en `/etc/logrotate.d/tomcatX` del archivo `/var/log/tomcat7/catalina.out`. Sin embargo, es necesario configurar una rotación con compresión de los archivos de logs `localhost_access_log.yyyy-mm-dd.txt`, ya que estos pueden llegar a ocupar mucho espacio.
|
|
|
|
|
|
Dependiendo donde se instale tomcat, el archivo de logrotate debería quedar de la siguiente forma:
|
|
|
|
|
|
```sh
|
|
|
/opt/tomcat/logs/*.log
|
|
|
/opt/tomcat/logs/*.txt
|
|
|
/opt/tomcat/logs/catalina.out {
|
|
|
copytruncate
|
|
|
weekly
|
|
|
rotate 52
|
|
|
compress
|
|
|
delaycompress
|
|
|
missingok
|
|
|
create 640 dspace adm
|
|
|
}
|
|
|
|
|
|
/opt/tomcat/logs/localhost_access_log.*.txt {
|
|
|
daily
|
|
|
compress
|
|
|
rotate 30
|
|
|
delaycompress
|
|
|
missingok
|
|
|
notifempty
|
|
|
create 640 dspace adm
|
|
|
}
|
|
|
``` |
|
|
\ No newline at end of file |