I use logrotate for nginx and php logs. By default it names files like:
access.log access.log.1 access.log.2.gz ... access.log.10.gz
I want to open all of the log files in less so I can search across them all etc. The problem is the naming scheme means less doesn't open them in the correct order if I open them with:
less access.log*
How do I do this right?
logrotate config:
/var/log/nginx/*.log {
daily
rotate 14
missingok
compress
delaycompress
notifempty
sharedscripts
prerotate
if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
run-parts /etc/logrotate.d/httpd-prerotate; \
fi \
endscript
postrotate
invoke-rc.d nginx rotate >/dev/null 2>&1 || true
passenger-config reopen-logs >/dev/null 2>&1 || true
endscript
}