Skip to content

JsonAccessLogValve: Add valve for structured logging#539

Closed
thomasmey wants to merge 1 commit intoapache:9.0.xfrom
thomasmey:feature/json-structured-accesslog
Closed

JsonAccessLogValve: Add valve for structured logging#539
thomasmey wants to merge 1 commit intoapache:9.0.xfrom
thomasmey:feature/json-structured-accesslog

Conversation

@thomasmey
Copy link
Copy Markdown
Contributor

Hi,

this adds a AccessLogValve which logs to stderr in JSON format.

sadly the existing code is very entagled in this regards, that the AccessLogElement does cover two functions: formatting and value fetching.

I tricked the existing code to output JSON by try to re-use most existing code/functions.
The result doesn't look to bad, but I'm happy to receive some feedback.

I also left in some comments for questions and ideas that came to my mind while coding.

Happy to hear your feedback.

@rmaucher
Copy link
Copy Markdown
Contributor

rmaucher commented Mar 3, 2023

I merged this with significant modifications. Thanks.

@rmaucher rmaucher closed this Mar 3, 2023
@rainerjung
Copy link
Copy Markdown
Contributor

@thomasmey I added support for all subkeyed patterns like request headers (%i), response headers (%o) etc. You might want to have a look and test it. It is now contained in the heads for all supported branches and will probably be released with the may releases.

@thomasmey
Copy link
Copy Markdown
Contributor Author

@rainerjung very nice, many thanks!

I just did test the version which landed in 9.0.74 ...

I will allocate some time next week and do some tests.

As you are also an httpd committer feel free to have a look at:
apache/httpd#353

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants