My Oracle Support Banner

OAG Access Log Response Time Is Negative Number (Doc ID 2012032.1)

Last updated on MARCH 10, 2023

Applies to:

Oracle API Gateway - Version 11.1.2.1.0 and later
Information in this document applies to any platform.

Symptoms

PROBLEM DESCRIPTION
-------------------------------------

After enabling access log on a production servers in OAG 11.1.2.3.0 using log pattern as follow:
%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i" RspHdr-Loc="%{Location}o" RqHdr-XFwdFor="%{X-Forwarded-For}i" RspTime="%D"
based on OAG and Apache documentation, %D should log response time in microseconds, but the resulting number is not in micro and also shows as a negative number such as the following:

localhost - - "GET http://<HOST>:<PORT>/<URI> HTTP/1.0" 200 - "" "" RspHdr-Loc="" RqHdr-XFwdFor="" RspTime="-19"
 - -  "GET http://<HOST>:<PORT>/<URI> HTTP/1.0" 200 - "" "" RspHdr-Loc="" RqHdr-XFwdFor="" RspTime="-21"
 - -  "GET /<URI>/<SERVICE>?wsdl HTTP/1.0" 200 .... "" ",Java/1.7.0_25" RspHdr-Loc="" RqHdr-XFwdFor=",<IP ADDRESS>" RspTime="-22"
 - -  "GET http://<HOST>:<PORT>/<URI> HTTP/1.0" 200 - "" "" RspHdr-Loc="" RqHdr-XFwdFor="" RspTime="-21"
 - -  "GET http://<HOST>:<PORT>/<URI> HTTP/1.0" 200 - "" "" RspHdr-Loc="" RqHdr-XFwdFor="" RspTime="-29"
- -  "GET http://<HOST>:<PORT>/<URI> HTTP/1.0" 200 - "" "" RspHdr-Loc="" RqHdr-XFwdFor="" RspTime="-25"
<HOST> - - "POST http://<HOST>:<PORT>/<URI> HTTP/1.0" 200 - "" "" RspHdr-Loc="" RqHdr-XFwdFor="" RspTime="-93"

ERROR
-------------

No error was received. However, the results are not what is expected.

WHAT IS WORKING
--------------------------------

The access log is getting populated but the RspTime shows as a negative value and also the value is not in micro seconds as expected.

ENVIRONMENT
------------
OAG 11.1.2.3
OS: Linux x86-64
Access log

STEPS
----------
1. Open Policy Studio
2. Click on Server Settings --> Expand Logging --> Click on Access Log then make sure the "Access Log Enabled" is checked.
2. Update Pattern to the following:
%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i" RspHdr-Loc="%{Location}o" RqHdr-XFwdFor="%{X-Forwarded-For}i" RspTime="%D"
3. Check "Enable Apache Access File Logger"
4. Under Listeners --> Default Services --> Paths, click on /healthcheck path.
5. In the Audit Settings tab, check "Include in server access log records" and click Ok
6. Deploy.
7. In a browser, type http://<GATEWAY HOST>:<EXAMPLE PORT>/healthcheck
8. Navigate to <OAG HOME>/apigateway/groups/group-<X>/instance-<Y>/logs/access, replacing x and y with the appropriate values for the environment, then open access.log; observe the following:

localhost - - "GET /healthcheck HTTP/1.0" 200 19 "" ",<BROWSER>" RspHdr-Loc="" RqHdr-XFwdFor="" RspTime="-11"

Notice that the RspTime is a negative value.



Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.