Is there a way to have Apache log slow requests? -


if page takes on couple of seconds process, i'd apache log url somewhere. possible? have lot of sites, looking automatic way opposed proprietary code each site.

take @ http://httpd.apache.org/docs/2.2/mod/mod_log_config.html. can setup custom log includes time took serve request.

for example:

logformat "%h %l %u %t \"%r\" %>s %b %d" common-time 

would add time in microseconds took serve request last field of logfile.

you add line httpd.conf, in each virtualhost want use it, add line:

customlog logs/access_log_time common-time 

you create new logformat contains want, maybe this:

logformat "\"%r\" %d" measure-time 

in virtualhost, can have multiple logs, have:

customlog logs/access_log common customlog logs/access_log_time measure-time 

all said, there's huge caveat. measure time takes server serve page. will not include time takes execute javascript in browser. if need measure javascript execution time, you'll need use tool firebug.

once you've got log, use apachelog parse logfile requests took longer whatever threshold want use.

i'm not sure if it's possible log long requests , bypss parsing step. might be, have feeling take significant amount of work.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -