Nika Gudge
asked on
how to add time taken to serve the request in ms in apache log configuration?
As per the mod_log_config 2.4 it says
%{UNIT}T The time taken to serve the request, in a time unit given by UNIT. Valid units are ms for milliseconds, us for microseconds, and s for seconds. Using s gives the same result as %T without any format; using us gives the same result as %D. Combining %T with a unit is available in 2.4.13 and later.
I used %{ms}T to view the time in ms but did not work.
%T i can view the time in sec but would like view the time in milliseconds.
Any suggestions would help.
%{UNIT}T The time taken to serve the request, in a time unit given by UNIT. Valid units are ms for milliseconds, us for microseconds, and s for seconds. Using s gives the same result as %T without any format; using us gives the same result as %D. Combining %T with a unit is available in 2.4.13 and later.
I used %{ms}T to view the time in ms but did not work.
%T i can view the time in sec but would like view the time in milliseconds.
Any suggestions would help.
Are you looking for a PHP answer? What is the exact information you want to capture?
ASKER
i want to capture time to serve the request in ms in custom log. I have added %{ms}T as below but does not work:
%{%d/%b/%Y %T}t.%{msec_frac}t %{%z}t %h \"%r\" %b %{ms}T
%{%d/%b/%Y %T}t.%{msec_frac}t %{%z}t %h \"%r\" %b %{ms}T
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hmm - that looks right to me. When you say it doesn't work, what do you mean - is it giving you a bad value, or no value at all? Did you restart the Apache service?
And also, are you making the change to the right log file? VirtualHosts can have their own log files, so if you don't change the right log...