LIBDRUM-962. Add custom Tomcat Access Log valve to support "logFile" JSON attribute#252
Merged
dsteelma-umd merged 5 commits intoumd-lib:drum-mainfrom Apr 15, 2025
Merged
Conversation
Subclass of stock Tomcat JsonAccessLogValve that allows an additional JSON attribute to be appended to the log entries. The additional attribute is appended by adding a "#<KEY>:<VALUE>#" pattern to the log's "pattern" configuration, where <KEY> is the JSON attribute key, and <VALUE> is the JSON attribute value. This is intended to provide a mechanism for identifying the log file the entry was intended for. https://umd-dit.atlassian.net/browse/LIBDRUM-962
Updated the "UmdTomcatWebServerFactoryCustomizer" which configures the Spring Boot embedded Tomcat server to use the "UmdExtendedJsonAccessLogValve" for logging when the "umd.server.tomcat.accesslog.json.enabled" property is set to "true". https://umd-dit.atlassian.net/browse/LIBDRUM-962
Updated the "DrumLogging.md" file to document the use of the UmdExtendedJsonAccessLogValve and appended JSON attribute. https://umd-dit.atlassian.net/browse/LIBDRUM-962
Updated the documentation to include setting the stock "server.tomcat.accesslog.enabled" property to "false", to prevent double-logging. https://umd-dit.atlassian.net/browse/LIBDRUM-962
95ca129 to
b7d86a5
Compare
GitHub Actions runs in UTC, instead of EST/ETD, so parameterized the timestamp in the expected log entries so the tests won't fail no matter what timezone the test is run in. https://umd-dit.atlassian.net/browse/LIBDRUM-962
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added "UmdExtendedJsonAccessLogValve" subclass of stock
Tomcat JsonAccessLogValve that allows an additional
JSON attribute to be appended to the log entries.
The additional attribute is appended by adding a "#:#"
pattern to the log's "pattern" configuration, where is the
JSON attribute key, and is the JSON attribute value.
This is intended to provide a mechanism for identifying the log file the
entry was intended for.
Updated the "UmdTomcatWebServerFactoryCustomizer" which configures the
Spring Boot embedded Tomcat server to use the
"UmdExtendedJsonAccessLogValve" for logging when the
"umd.server.tomcat.accesslog.json.enabled" property is set to "true".
Updated the "DrumLogging.md" file to document the use of the
UmdExtendedJsonAccessLogValve and appended JSON attribute.
https://umd-dit.atlassian.net/browse/LIBDRUM-962