Is there any way to intercept Apache (1 or 2) access logs to stdout without :
- modifying the config files
- restarting the service
Currently my apache config file specifies "CustomLog /dev/null common" System is Debian Etch.
Thanks in advance serverfault community !
EDIT : The idea would be to do what "strace -p" does with processes. I hoped apache2ctl or something would have a "dump current accesses" feature :D
You might want to explain what your requirements and limitations are in more detail if you're looking for a solution to a particular problem. But as it stands, simply:
Nope.
Nope.
Update:
It hadn't occured to me of using
strace
. But indeed, you could use it to inspect thewrite()
calls.You're going to run into some difficulty though keeping track of processes. I don't think that strace's fork detection will necessarily help you. Which means that you'll be constantly running around to find which process handled a given request.
As for such a feature in Apache. That's horrible and wouldn't exist. I think you're an edge case ;)
How about changing the config files temporarily, and reloading them? You're asking to reconfigure apache, plain and simple. There's an Apache "reload" function that will use the new config without dropping active connections, if your concern is availability.
EDIT: This is the craziest thing I've ever seen: fdmess
I'm not entirely sure what you are trying to achieve, but if you are just wanting to watch the logs as they update on stdout... you can view the Apache access or error logs, in real time as they update, using the "follow" option of
tail
For example
tail -f /var/log/apache2/access.log
Tail man page
Guys, how about using urlsnarf ?