logrotate und vermeiden von duplicate logentry
Hi,
ich möchte für meinen Apache-SSL die PHP-Fehler in ein Logfile
schreiben, anstatt sie anzuzeigen. Dazu habe ich
ein /var/log/apache-ssl/php_error.log angelegt.
Das würde automatisch über /etc/logrotate.d/apache-ssl gefüllt -
allerdings steht dort für *.log drin:
create 640 root adm - logischerweise kann php nicht schreiben.
Ich habe nun in der apache-ssl einen zweiten Eintrag gesetzt, namens
/var/log/apache-ssl/php_error.log {
mit u.a. der Zeile
create 640 www-data-www-data
Nun meckert logrotate zu recht:
/etc/cron.daily/logrotate:
error: apache-ssl:20 duplicate log entry
for /var/log/apache-ssl/php_error.log
run-parts: /etc/cron.daily/logrotate exited with return code 1
Da Apache mehrere Logfiles produziert, möchte ich eigentlich nicht
gezwungen sein, für jedes Logfile einen Eintrag in
der /etc/logrotate.d/apache-ssl zu machen. Besser wäre es doch, ich
könnte sagen: "Nimm für alle Logfiles außer dem php_error.log folgende
Einstellungen". Oder so.
Geht das, und wenn ja wie?
thx
Hiro
Hier nochmal die nicht funktionierende etc/logrotate.d/apache-ssl:
/var/log/apache-ssl/*.log {
weekly
missingok
rotate 52
compress
delaycompress
notifempty
create 640 root adm
sharedscripts
postrotate
if [ -f /var/run/apache-ssl.pid ]; then \
if [ -x /usr/sbin/invoke-rc.d ]; then \
invoke-rc.d apache-ssl reload > /dev/null; \
else \
/etc/init.d/apache-ssl reload > /dev/null; \
fi; \
fi;
endscript
}
/var/log/apache-ssl/php_error.log {
weekly
missingok
rotate 52
compress
delaycompress
notifempty
create 640 www-data www-data
sharedscripts
postrotate
if [ -f /var/run/apache-ssl.pid ]; then \
if [ -x /usr/sbin/invoke-rc.d ]; then \
invoke-rc.d apache-ssl reload > /dev/null; \
else \
/etc/init.d/apache-ssl reload > /dev/null; \
fi; \
fi;
endscript
}
--
Hi! I'm a .sig virus! Copy me to your .sig!
Reply to: