Done
Pinned fields
Click on the next to a field label to start pinning.
Details
Assignee
Damien JohnsonDamien Johnson(Deactivated)Reporter
Damien JohnsonDamien Johnson(Deactivated)Capitalizable
TrueStory Points
5Time remaining
0hSprint
NoneFix versions
Priority
Medium
Details
Details
Assignee
Damien Johnson
Damien Johnson(Deactivated)Reporter
Damien Johnson
Damien Johnson(Deactivated)Capitalizable
True
Story Points
5
Time remaining
0h
Sprint
None
Fix versions
Priority
Created April 23, 2019 at 4:57 PM
Updated June 27, 2019 at 6:38 PM
Resolved June 19, 2019 at 12:57 PM
A new logging service is necessary to provide flexible, reliable logging (especially access logging). The service will track HTTP interactions along with relevant data for those interactions. It will use this data to render user-provided templates which will then be logged.
The service should provide additional support certain data formats (i.e., JSON). Additional support should include proper escaping and validation.
The JTwig templating engine can be used to render templates.
See the linked spike for more details.
We should be able to specify the logger (like the SLF4J and Herp filters currently do).
Acceptance Criteria
This will be a new service.
Users should be able to write their own templates on the formatting of the access logs.
Template format should not collide with the other template formats already in use in Repose.
There should be a mechanism for users to specify that the template is JSON. This will do two things. Template values should be JSON escaped, and the template should be validated on Repose startup service loading to ensure it's valid JSON.
If the template doesn't validate with sample/dummy data applied, a WARNING log should be emitted on service loading. Otherwise, no other action should be taken (i.e. use the config anyway).
It must be possible to log every request.
It should be able to log the following attributes of a request and/or response:
HTTP Header values (
%i, %o
)The values should be the last values we can reasonably get
Request values
Right before going to the origin service or
Right before a filter rejects a request or throws an error. We do not need the values added by the filter that rejected the request or threw an error.
Response values
Right before the filter chain finishes process (i.e. right before returning to the client)
Remote/Local IP address (
%a, %A
)Size of request and response (
%b, %B
)This will simply be the value in the
Content-Length
headerRemote host (
%h
)Request method (
%m
)Request protocol (
%H
)Response protocol (if possible/feasible)
I'd like to know if the client used HTTP 1.0 or 1.1 and if the origin service responded with HTTP 1.0 or 1.1.
Response status message (
%M
)Query string of the URL (
%q
)Response status code (
%s
)Time the request was received (
%t
)ISO 8601
Time taken to serve the request (
%D, %T
)Time taken to serve the request by the origin service
Default to some value when the origin service isn't hit
This value might also end up being some large value if we timed out waiting for the origin service
URL requested (
%U
)Username (
%u
)Tracing ID (
%g
)When writing headers (which can be a list of values), we should enable the user to specify how it should be outputted.
They should have the option of generating a comma-separated list at the very least.
A reasonable default template should be supplied.
That template is: (TBD)