forked from 3scale/APIcast
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Policy: logging add custom access log options
Some users requested different ways to log access log with more metadata, different formats or conditional logging based on multiple request values. This policy address this, two new variables are now set, where allow or disallow to print a custom log message, and another one `extened_access_log` just store all the information to print that. Policy has multiple options, here a few examples: Custom log format ``` { "name": "apicast.policy.logging", "configuration": { "enable_access_logs": false "custom_logging": "\"{{request}}\" to service {{service.id}} and {{service.name}}", } } ``` Only log the entry if status is 200 ``` { "name": "apicast.policy.logging", "configuration": { "enable_access_logs": false "custom_logging": "\"{{request}}\" to service {{service.id}} and {{service.name}}", "condition": { "operations": [ {"op": "==", "match": "{{status}}", "match_type": "liquid", "value": "200"} ], "combine_op": "and" } } } ``` This commit fixed 3scale#1082 and THREESCALE-1234 and THREESCALE-2876 Signed-off-by: Eloy Coto <eloy.coto@gmail.com>
- Loading branch information
Showing
2 changed files
with
109 additions
and
3 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