1.Копируем три файла с httpd в nginx
1 |
# cp /usr/share/logwatch/default.conf/services/http.conf /etc/logwatch/conf/services/nginx.conf |
1 |
# cp /usr/share/logwatch/default.conf/logfiles/http.conf /etc/logwatch/conf/logfiles/nginx.conf |
1 |
# cp /usr/share/logwatch/scripts/services/http /etc/logwatch/scripts/services/nginx |
2.Редактируем /etc/logwatch/conf/services/nginx.conf
1 |
# cat /etc/logwatch/conf/services/nginx.conf | grep nginx |
1 2 |
Title = "nginx" LogFile = nginx |
3.Приводим к виду файл /etc/logwatch/conf/logfiles/nginx.conf
1 |
# cat /etc/logwatch/conf/logfiles/nginx.conf | grep -v \# | grep -v ^$ |
1 2 3 4 |
LogFile = nginx/*access.log Archive = nginx/*access.log-*.gz *ExpandRepeats *ApplyhttpDate |
4.Тестируем работоспособность, запуская logwatch
1 |
# logwatch |
Источник:
http://rtfm.co.ua/nginx-dobavlenie-logov-pod-monitoring-logwatch/