Apache logs by day
I'm working with Apache and JBoss. The latter's way to keep logs is quite fine in the sense it keeps (when chosen in log4j) logs of the same day in the same file. This makes logs, backups and statistics more manageable.
Is that开发者_StackOverflow possible to be achieved in Apache? One log file per day with all info of that day only in that file?
Yes there's lots of ways of doing this - mostly dependant on which OS this is running on - you didn't say.
You can run an external program like logrotate which moves the files around and tells apache to flush/close/reopen its file handles.
Alternatively, Apache httpd comes with a utility called rotatelogs which is usually configured as a log output filter.
maybe you can try this
awk '{print $4}' example.log | cut -d: -f1 | uniq -c
精彩评论