Skip to content

LIBDRUM-962. Add custom Tomcat Access Log valve to support "logFile" JSON attribute#252

Merged
dsteelma-umd merged 5 commits intoumd-lib:drum-mainfrom
dsteelma-umd:feature/LIBDRUM-962
Apr 15, 2025
Merged

LIBDRUM-962. Add custom Tomcat Access Log valve to support "logFile" JSON attribute#252
dsteelma-umd merged 5 commits intoumd-lib:drum-mainfrom
dsteelma-umd:feature/LIBDRUM-962

Conversation

@dsteelma-umd
Copy link

@dsteelma-umd dsteelma-umd commented Apr 15, 2025

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

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
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
@dsteelma-umd dsteelma-umd merged commit 7eca25b into umd-lib:drum-main Apr 15, 2025
10 checks passed
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.

1 participant