Dgraph request log

The Dgraph request log (also called the query log) contains one entry for each request processed.

The request log name and storage location is specified by the Dgraph --log flag. By default, the name and location of the log file is set to:
$BDD_HOME/dgraph/bin/dgraph.reqlog
The format of the Dgraph request log consists of the following fields:
  • Field 1: Timestamp (yyyy-MM-dd HH:mm:ss.SSS Z).
  • Field 2: Client IP Address.
  • Field 3: Request ID.
  • Field 4: ECID. The ECID (Execution Context ID) is a global unique identifier of the execution of a particular request in which the originating component participates. You can use the ECID to correlate error messages from different components. Note that the ECID comes from the HTTP header, so the ECID value may be null or undefined if the client does not provide it to the Dgraph.
  • Field 5: Response Size (bytes).
  • Field 6: Total Time (fractional milliseconds).
  • Field 7: Processing Time (fractional milliseconds).
  • Field 8: HTTP Response Code (0 on client disconnect).
  • Field 9: - (unused).
  • Field 10: Queue Status. On request arrival, the number of requests in queue (if positive) or the number of available slots at the same priority (if negative).
  • Field 11: Thread ID.
  • Field 12: HTTP URL (URL encoded).
  • Field 13: HTTP POST Body (URL encoded; truncated to 64KBytes, by default; - if empty).
  • Field 14: HTTP Headers (URL encoded).

Note that a dash (-) is entered for any field for which information is not available or pertinent. The requests are sorted by their timestamp.

By default, the Dgraph truncates the contents of the body for POST requests at 64K. This default setting saves disk space in the log, especially during the process of adding large numbers of records to a Dgraph database. If you need to review the log for the full contents of the POST request body, contact Oracle Support.

Using grep on the Dgraph request log

When diagnosing performance issues, you can use grep with a distinctive string to find individual requests in the Dgraph request log. For example, you can use the string:
value%3D%22RefreshDate
If you have Studio, it is more useful to find the X-Endeca-Portlet-Id HTTP Header for the portlet sending the request, and grep for that. This is something like:
X-Endeca-Portlet-Id: endecaresultslistportlet_WAR_endecaresultslistportlet_INSTANCE_5RKp_LAYOUT_11601
As an example, if you set:
PORTLET=endecaresultslistportlet_WAR_endecaresultslistportlet_INSTANCE_5RKp_LAYOUT_11601
then you can look at the times and response codes for the last ten requests from that portlet with a command such as:
grep $PORTLET Discovery.reqlog | tail -10 | cut -d ' ' -f 6,7,8

The command produces output similar to:

20.61 20.04 200
80.24 79.43 200
19.87 18.06 200
79.97 79.24 200
35.18 24.36 200
87.52 86.74 200
26.65 21.52 200
81.64 80.89 200
28.47 17.66 200
82.29 81.53 200
There are some other HTTP headers that can help tie requests together:
  • X-Endeca-Portlet-Id — The unique ID of the portlet in the application.
  • X-Endeca-Session-Id — The ID of the user session.
  • X-Endeca-Gesture-Id — The ID of the end-user action (not filled in unless Studio has CLIENT logging enabled).
  • X-Endeca-Request-Id — If multiple dgraph requests are sent for a single Dgraph Gateway request, they will all have the same X-Endeca-Request-Id.