Customizing the HTTP access log

You can customize the format of the default HTTP access log.

By default, WebLogic Server keeps a log of all HTTP transactions in a text file. The file is named access.log and is located in the $DOMAIN_HOME/servers/<ServerName>/logs directory.

The log provides true timing information from WebLogic, in terms of how long each individual Dgraph Gateway request takes. This timing information can be important in troubleshooting a slow system.

Note that this setup needs to be done on a per-server basis. That is, in a clustered environment, this has to be done for the Admin Server and for every Managed Server. This is because the clone operation (done when installing a clustered environment) does not carry over access log configuration.

The default format for the file is the common log format, but you can change it to the extended log format, which allows you to specify the type and order of information recorded about each HTTP communication. This topic describes how to add the following identifiers to the file:
  • date — Date on which transaction completed, field has type <date>, as defined in the W3C specification.
  • time — Time at which transaction completed, field has type <time>, as defined in the W3C specification.
  • time-taken — Time taken for transaction to complete in seconds, field has type <fixed>, as defined in the W3C specification.
  • cs-method — The request method, for example GET or POST. This field has type <name>, as defined in the W3C specification.
  • cs-uri — The full requested URI. This field has type <uri>, as defined in the W3C specification.
  • sc-status — Status code of the response, for example (404) indicating a "File not found" status. This field has type <integer>, as defined in the W3C specification.

To customize the HTTP access log:

  1. Log into the Administration Server console.
  2. In the Change Center of the Administration Console, click Lock & Edit.
  3. In the left pane of the Console, expand Environment and select Servers.
  4. In the Servers table, click the Managed Server name.
  5. In the Settings for <serverName> page, select Logging > HTTP.
  6. On the Logging > HTTP page, make sure that you select the HTTP access log file enabled check box.
  7. Click Advanced.
  8. In the Advanced pane:
    1. In the Format drop-down box, select Extended.
    2. In the Extended Logging Format Fields, enter this space-delimited string:
      date time time-taken cs-method cs-uri sc-status
  9. Click Save.
  10. In the Change Center of the Administration Console, click Activate Changes.
  11. Restart WebLogic Server by running the bdd-admin script with the restart command. For example:
    ./bdd-admin.sh restart -c bddServer -n web05.us.example.com
    For information on the restart command, see restart.