Igor Kromin |   Consultant. Coder. Blogger. Tinkerer. Gamer.

Recently I was asked to investigate how long our web service requests were taking to process at the level of the application server. We had logging inside the web services for total elapsed time serving a request, but we wanted to see if there was any overhead within the app server. Our app server is 10gAS with Apache 1.3 as the web tier.

When I first started looking into this, I thought the task will be quite straight forward and all I would have to do was edit the httpd.conf file CustomLog line for the common log, which is used for access logging. I was wrong on this one. After editing this file and restarting, the access log output didn't change.

The thing that I forgot to take into account was that all our services run over SSL, which meant that the access log configuration in httpd.conf is not used! So with this in mind, I opened up the ssl.conf file and found my VirtualHost configuration.

The config file is in: $ORACLE_HOME/Apache/Apache/conf/ssl.conf

In the "General setup for the virtual host", I found a TransferLog line, which I changed to the LogFormat and CustomLog lines instead as per below. The %D parameter logs the time to serve the request.
 $ Apache/conf/ssl.conf
<VirtualHost _default_:9999>
...
#TransferLog "|/u01/product/10.1.3.1/OracleAS_1/Apache/Apache/bin/rotatelogs /u01/product/10.1.3.1/OracleAS_1/Apache/Apache/logs/access_log 43200"
LogFormat "%h %l %u %t "%r" %>s %b Bytes: %B Time: %D" common
CustomLog "|/u01/product/10.1.3.1/OracleAS_1/Apache/Apache/bin/rotatelogs /u01/product/10.1.3.1/OracleAS_1/Apache/Apache/logs/access_log 43200" common
...
</VirtualHost>


After a restart, the access log started showing me the request times as expected.

The only catch here is that the request times are in whole seconds, there is no sub-second precision. Apache 2.x has an option to output the microseconds elapsed, sadly this was not available in 1.3.



-i

A quick disclaimer...

Although I put in a great effort into researching all the topics I cover, mistakes can happen. Use of any information from my blog posts should be at own risk and I do not hold any liability towards any information misuse or damages caused by following any of my posts.

All content and opinions expressed on this Blog are my own and do not represent the opinions of my employer (Oracle). Use of any information contained in this blog post/article is subject to this disclaimer.
Hi! You can search my blog here ⤵
NOTE: (2022) This Blog is no longer maintained and I will not be answering any emails or comments.

I am now focusing on Atari Gamer.