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

How can I log Apache's performance, i.e. how it takes to process a request? Similar to Tomcat's Valve concept, I'd like to add this logging on Apache to identify a bottleneck on my web app.

I'm using Apache and Tomcat via mod_jk.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

You have to create a new log format that adds on response time.

LogFormat "\"%{%Y-%m-%d %H:%M:%S}t\" %V %m \"%U\" \"%q\" %{Content-Type}o %s %B %O %D" responsetime
CustomLog "/var/log/apache2/responsetime.log" responsetime

The %D adds the response time in microseconds to the log. So you can always make your own format for the access log just include the %D somewhere in the log

share|improve this answer
    
Add that to httpd.conf? –  Kevin Meredith Jun 13 '13 at 14:51
    
yep you can add it there or in a vhost entry –  Mike Jun 13 '13 at 14:53
    
Thank you, Mike –  Kevin Meredith Jun 13 '13 at 14:53

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.