7/12 Hello MOTD, sorry to bother you (again) but you always know
all the good (and bad) apps. I am looking for log utilities
to manage my apache logs. I need something to rotate/gzip/etc.
the logs and something to do simple analysis (and some historical)
I'd prefer a script where i can see what is going on over a binary
like webalizer, but whatever. As for the rotatelog utility that
comes with apache, it is broke in the version i am running and i
don't want to upgrade.
\_ If you want to do this correctly, you need Apache's rotatelogs
utility, which almost certainly works in the version you have, but
not in the way you want it to. What rotatelogs does is accept web
logs on stdin and write them to files with seconds-since-the-epoch
filenames, starting a new file once a week. You need that, because
you can't move the logs out from under Apache safely (and if
you do, you need to restart the server, which would cause
disruption of service). So then you just write a cron job to
gzip the logs, and use analog to analyze them (analog will also
analyze gzip'ped logs). -tom
\_ I have an error_log.0994896000 that goes back to yesterday
AND i have an error_log that goes back a long long time.
This is broke or (perhaps more likely) i am doing something
wrong. What would you suggest i am doing wrong?
\_ you have to set up rotatelogs on your ErrorLog
line as well as your TransferLog or CustomLog
line in httpd.conf. -tom
\_ Or cronolog, which lets you specify the naming scheme --dbushong
\_ rotatelogs blows. cronolog is much better. -ERic
\_ Hey tom, why is it unsafe to move logs out from under Apache
if you restart it? Also, restarting Apache takes something
on the order of seconds, so the disruption of service is
nigh-invisble, is it not?
- Rotates logs manually and restarts Apache
\_ It depends what you're serving. If someone is downloading
a big file, for example, either their download will hold up
the server respawning, or the download will be killed when
you restart. If you have only small content and don't
care if you occasionally serve broken images or pages,
it's not so bad. Still, it doesn't cost much to do it
right. -tom
\_ I ran an app that was using jserv, and stopping and
restarting apache was a major pain. rotatelogs was
the best solution. -ERic |