You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor all logging throughout Kroxylicious to use SLF4J's fluent API with structured key-value pairs, replacing string concatenation and placeholder-based logging.
Changes include:
- Configure Log4j2 with routing appender supporting both text and JSON formats via `KROXYLICIOUS_LOG_FORMAT` environment variable
- Update pattern layout to display structured context with `%K{ctx}`
- Refactor logging across all modules (runtime, filters, KMS providers, operator, app) to fluent style with addKeyValue() calls
- Fix conditional logging to avoid unnecessary string construction
- Standardise logger naming across modules
- Update tests for structured logging assertions
The new logging format supports both human-readable text output (default) and structured JSON output for log aggregation systems.
Assisted-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Tom Bentley <tbentley@redhat.com>
<propertyname="message"value="Use fluent API with addKeyValue() instead of parameterized logging with '{''}'. Example: LOGGER.atInfo().addKeyValue("key", value).log("message"). [not required for tests]" />
102
+
<propertyname="ignoreComments"value="true" />
103
+
</module>
104
+
105
+
<!-- Standardize logger naming to LOGGER (not LOG) -->
NOTE: Setting the root log level to `DEBUG` or `TRACE` will produce very verbose logs.
36
+
37
+
[id='proc-proxy-json-log-format-{context}']
38
+
== Switching to JSON log format
39
+
40
+
By default, Kroxylicious outputs logs in human-readable text format. You can switch to structured JSON output for integration with log aggregation systems.
41
+
42
+
.Procedure
43
+
44
+
. Set the `KROXYLICIOUS_LOG_FORMAT` environment variable:
Copy file name to clipboardExpand all lines: kroxylicious-filters/kroxylicious-authorization/src/main/java/io/kroxylicious/filter/authorization/Authorization.java
Copy file name to clipboardExpand all lines: kroxylicious-filters/kroxylicious-authorization/src/main/java/io/kroxylicious/filter/authorization/AuthorizationFilter.java
0 commit comments