-
Notifications
You must be signed in to change notification settings - Fork 603
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(log) http-log authentication and retries logging
Deals with Kong issue 2429: logging retries and failure info and 2430 for adding a basic auth header with the http log plugin
- Loading branch information
Showing
6 changed files
with
93 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,11 +40,15 @@ form parameter | default | description | |
--- | --- | --- | ||
`name` | | The name of the plugin to use, in this case: `http-log` | ||
`consumer_id`<br>*optional* | | The CONSUMER ID that this plugin configuration will target. This value can only be used if [authentication has been enabled][faq-authentication] so that the system can identify the user making the request. | ||
`config.http_endpoint` | | The HTTP endpoint (including the protocol to use) where to send the data to | ||
`config.http_endpoint` | | The HTTP endpoint (including the protocol to use) to which the data will be sent. | ||
`config.method`<br>*optional* | `POST` | An optional method used to send data to the http server, other supported values are PUT, PATCH | ||
`config.timeout`<br>*optional* | `10000` | An optional timeout in milliseconds when sending data to the upstream server | ||
`config.keepalive`<br>*optional*| `60000` | An optional value in milliseconds that defines for how long an idle connection will live before being closed | ||
|
||
**NOTE:** If the `config.http_endpoint` contains a username and password (ex. | ||
`http://bob:[email protected]/logs`), then Kong will automatically include | ||
a basic-auth `Authorization` header in the log requests. | ||
|
||
[api-object]: /docs/latest/admin-api/#api-object | ||
[configuration]: /docs/latest/configuration | ||
[consumer-object]: /docs/latest/admin-api/#consumer-object | ||
|
@@ -83,9 +87,21 @@ Every request will be logged separately in a JSON object, with the following for | |
"access-control-allow-origin": "*" | ||
} | ||
}, | ||
"tries": [ | ||
{ | ||
"state": "next", | ||
"code": 502, | ||
"ip": "127.0.0.1", | ||
"port": 8000 | ||
}, | ||
{ | ||
"ip": "127.0.0.1", | ||
"port": 8000 | ||
} | ||
], | ||
"authenticated_entity": { | ||
"consumer_id": "80f74eef-31b8-45d5-c525-ae532297ea8e", | ||
"id": "eaa330c0-4cff-47f5-c79e-b2e4f355207e", | ||
"id": "eaa330c0-4cff-47f5-c79e-b2e4f355207e" | ||
}, | ||
"api": { | ||
"created_at": 1488830759000, | ||
|
@@ -118,6 +134,7 @@ A few considerations on the above JSON object: | |
|
||
* `request` contains properties about the request sent by the client | ||
* `response` contains properties about the response sent to the client | ||
* `tries` contains the list of (re)tries (successes and failures) made by the load balancer for this request | ||
* `api` contains Kong properties about the specific API requested | ||
* `authenticated_entity` contains Kong properties about the authenticated consumer (if an authentication plugin has been enabled) | ||
* `latencies` contains some data about the latencies involved: | ||
|
@@ -129,4 +146,7 @@ A few considerations on the above JSON object: | |
|
||
## Kong Process Errors | ||
|
||
This logging plugin will only log HTTP request and response data. If you are looking for the Kong process error file (which is the nginx error file), then you can find it at the following path: {[prefix](/docs/{{site.data.kong_latest.release}}/configuration/#prefix)}/logs/error.log | ||
This logging plugin will only log HTTP request and response data. If you are | ||
looking for the Kong process error file (which is the nginx error file), then | ||
you can find it at the following path: | ||
`{[prefix](/docs/{{site.data.kong_latest.release}}/configuration/#prefix)}/logs/error.log`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters