Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sometimes we have an HTTP server running where you can see that it starts to act out. Without restarting it I want to start to log all HTTP requests.

Are there any tools that allows you to add some kind of logging to an HTTP server, while the server keeps running? I'm not looking for a tool where you have to do something before you start the server since this is not an option in the given case.

Note: We do have the option of changing ports of the running server, so it's possible to add a process before the request actually hits the server I want to add logging to. And we're using Linux.

share|improve this question

1 Answer 1

You didn't mention what you are using as your HTTP server. Since you are on Linux, I will take a guess and say Apache. If that is the case, logging should be enabled by default. I don't know why you would disable it - perhaps for performance reasons, but it's a simple task to enable it and reload the service, without the need to restart it. This would be done in httpd.conf and the logs (by default) go in /var/log/httpd.

If you are attached to the idea of having some other process do the logging for you, and then pass the traffic on to your HTTP service, keep in mind that this will incur far more of a performance hit than simply enabling logging, but if you really want to do it, two good options would be Squid and Apache. Squid is a Linux web proxy that can be configured as a reverse proxy that will route (and log) incoming traffic for you. Apache has the same capability, with the Proxy and/or Rewrite directives.

I hope this helps lead you in the right direction.

share|improve this answer
    
Sorry for the confusion. We have programmed our own HTTP server. The point of the question was to say that you have a black box HTTP server that you want to add logging to it on realtime. It seems that Squid is doing a lot of things. You mention the overhead, which is a real issue. So the reverse proxy will have to be minimal. –  freeall May 16 '13 at 9:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.