tomcat
tomcat copied to clipboard
JsonAccessLogValve: Add valve for structured logging
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.