Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JsonAccessLogValve: Add valve for structured logging #539

Closed

Conversation

thomasmey
Copy link
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
Contributor

rmaucher commented Mar 3, 2023

I merged this with significant modifications. Thanks.

@rmaucher rmaucher closed this Mar 3, 2023
@rainerjung
Copy link
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
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