-
Notifications
You must be signed in to change notification settings - Fork 4
Maintenance: Leverage Spring 3.4 structured logging features #605
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
Maintenance: Leverage Spring 3.4 structured logging features #605
Conversation
""" WalkthroughThis change set removes the Logstash Logback encoder dependency and its associated XML logging configuration and JSON logging test classes from multiple modules. Logging configuration is migrated from XML to YAML format, introducing or updating properties for structured logging, application metadata (name, group, version), and log levels. Banner files are updated to display both application name and group. Changes
Sequence Diagram(s)sequenceDiagram
participant App as Spring Boot Application
participant YAML as application.yml / application-local.yml
participant Console as Console Output
App->>YAML: Load logging and application metadata configuration
App->>Console: Emit logs formatted per YAML settings (structured or pattern)
Estimated code review effort2 (~15 minutes) Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (6)
✅ Files skipped from review due to trivial changes (3)
🚧 Files skipped from review as they are similar to previous changes (3)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 7
🧹 Nitpick comments (3)
refarch-gateway/src/main/resources/banner.txt (1)
2-2
: Provide a fallback for${spring.application.group}
to avoid unresolved placeholdersIf
spring.application.group
is not defined for a given profile, the banner will literally print${spring.application.group}
. Append a default (:
) so the placeholder resolves to an empty string instead of the raw token.-${spring.application.name} (${spring.application.group}) +${spring.application.name} (${spring.application.group:})refarch-gateway/src/main/resources/application.yml (1)
83-85
: Minor: property reference typo
spring.application.version
does not exist (you addedspring.application.version
in this file, notversion
). Either change the property key or reference${spring.application.version}
consistently elsewhere.refarch-integrations/refarch-s3-integration/refarch-s3-integration-rest/refarch-s3-integration-rest-service/src/main/resources/banner.txt (1)
2-2
: Placeholder expansion will print “None” ifspring.application.group
is unset
(${spring.application.group})
renders literally whenspring.application.group
is missing, producing “(null)” in the banner.
Consider adding a default (${spring.application.group:}
) or guarding with a profile-specific banner.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (18)
refarch-gateway/pom.xml
(0 hunks)refarch-gateway/src/main/resources/application-local.yml
(1 hunks)refarch-gateway/src/main/resources/application.yml
(2 hunks)refarch-gateway/src/main/resources/banner.txt
(1 hunks)refarch-gateway/src/main/resources/logback-spring.xml
(0 hunks)refarch-gateway/src/test/java/de/muenchen/refarch/gateway/configuration/LogbackJsonLoggingTest.java
(0 hunks)refarch-gateway/src/test/resources/application-test.yml
(1 hunks)refarch-integrations/pom.xml
(0 hunks)refarch-integrations/refarch-cosys-integration/refarch-cosys-integration-example/src/main/resources/application-local.yml
(2 hunks)refarch-integrations/refarch-dms-integration/refarch-dms-integration-example/src/main/resources/application-example.yml
(0 hunks)refarch-integrations/refarch-dms-integration/refarch-dms-integration-example/src/main/resources/application-local.yml
(1 hunks)refarch-integrations/refarch-email-integration/refarch-email-integration-example/src/main/resources/application-local.yml
(2 hunks)refarch-integrations/refarch-s3-integration/refarch-s3-integration-rest/refarch-s3-integration-rest-service/pom.xml
(0 hunks)refarch-integrations/refarch-s3-integration/refarch-s3-integration-rest/refarch-s3-integration-rest-service/src/main/resources/application-local.yml
(1 hunks)refarch-integrations/refarch-s3-integration/refarch-s3-integration-rest/refarch-s3-integration-rest-service/src/main/resources/application.yml
(2 hunks)refarch-integrations/refarch-s3-integration/refarch-s3-integration-rest/refarch-s3-integration-rest-service/src/main/resources/banner.txt
(1 hunks)refarch-integrations/refarch-s3-integration/refarch-s3-integration-rest/refarch-s3-integration-rest-service/src/main/resources/logback-spring.xml
(0 hunks)refarch-integrations/refarch-s3-integration/refarch-s3-integration-rest/refarch-s3-integration-rest-service/src/test/java/de/muenchen/refarch/integration/s3/configuration/LogbackJsonLoggingTest.java
(0 hunks)
🪛 YAMLlint (1.37.1)
refarch-integrations/refarch-email-integration/refarch-email-integration-example/src/main/resources/application-local.yml
[error] 3-3: syntax error: found character '@' that cannot start any token
(syntax)
refarch-integrations/refarch-s3-integration/refarch-s3-integration-rest/refarch-s3-integration-rest-service/src/main/resources/application.yml
[error] 5-5: syntax error: found character '@' that cannot start any token
(syntax)
refarch-integrations/refarch-cosys-integration/refarch-cosys-integration-example/src/main/resources/application-local.yml
[error] 3-3: syntax error: found character '@' that cannot start any token
(syntax)
refarch-gateway/src/main/resources/application-local.yml
[error] 52-52: no new line character at the end of file
(new-line-at-end-of-file)
refarch-integrations/refarch-dms-integration/refarch-dms-integration-example/src/main/resources/application-local.yml
[error] 3-3: syntax error: found character '@' that cannot start any token
(syntax)
💤 Files with no reviewable changes (8)
- refarch-integrations/refarch-s3-integration/refarch-s3-integration-rest/refarch-s3-integration-rest-service/pom.xml
- refarch-gateway/pom.xml
- refarch-integrations/pom.xml
- refarch-integrations/refarch-s3-integration/refarch-s3-integration-rest/refarch-s3-integration-rest-service/src/main/resources/logback-spring.xml
- refarch-integrations/refarch-dms-integration/refarch-dms-integration-example/src/main/resources/application-example.yml
- refarch-gateway/src/test/java/de/muenchen/refarch/gateway/configuration/LogbackJsonLoggingTest.java
- refarch-gateway/src/main/resources/logback-spring.xml
- refarch-integrations/refarch-s3-integration/refarch-s3-integration-rest/refarch-s3-integration-rest-service/src/test/java/de/muenchen/refarch/integration/s3/configuration/LogbackJsonLoggingTest.java
🧰 Additional context used
🪛 YAMLlint (1.37.1)
refarch-integrations/refarch-email-integration/refarch-email-integration-example/src/main/resources/application-local.yml
[error] 3-3: syntax error: found character '@' that cannot start any token
(syntax)
refarch-integrations/refarch-s3-integration/refarch-s3-integration-rest/refarch-s3-integration-rest-service/src/main/resources/application.yml
[error] 5-5: syntax error: found character '@' that cannot start any token
(syntax)
refarch-integrations/refarch-cosys-integration/refarch-cosys-integration-example/src/main/resources/application-local.yml
[error] 3-3: syntax error: found character '@' that cannot start any token
(syntax)
refarch-gateway/src/main/resources/application-local.yml
[error] 52-52: no new line character at the end of file
(new-line-at-end-of-file)
refarch-integrations/refarch-dms-integration/refarch-dms-integration-example/src/main/resources/application-local.yml
[error] 3-3: syntax error: found character '@' that cannot start any token
(syntax)
🔇 Additional comments (7)
refarch-integrations/refarch-dms-integration/refarch-dms-integration-example/src/main/resources/application-local.yml (1)
8-12
: Verify existence oflogging.include-application-group
propertyI could not find this key in Spring Boot 3.4 logging properties. If it is a custom extension, ignore this comment; otherwise the property will be silently ignored.
Please confirm against the Spring Boot docs or replace with the intended key (e.g.
logging.include-application-name
).refarch-integrations/refarch-cosys-integration/refarch-cosys-integration-example/src/main/resources/application-local.yml (1)
19-24
: Verify property keylogging.include-application-group
is supportedSpring Boot 3.4 introduces
logging.include-application-name
,…-version
, and…-group
, but early milestones still used a different flag. Make sure the target Boot version actually recogniseslogging.include-application-group
; otherwise the setting will be ignored.
If unsure, run the app with--debug
and check the “Unknown property” diagnostics.refarch-integrations/refarch-email-integration/refarch-email-integration-example/src/main/resources/application-local.yml (1)
15-21
: Verified Spring Boot version supportslogging.include-application-group
- refarch-integrations/pom.xml declares Spring Boot Starter Parent version 3.5.3
- refarch-gateway/pom.xml declares Spring Boot Starter Parent version 3.5.3
Both are ≥ 3.4, so the
logging.include-application-group
property is supported—no further changes needed.refarch-gateway/src/test/resources/application-test.yml (1)
29-34
: Looks good – test profile logging overrides are clear and isolated
The properties cleanly disable structured output and group metadata for tests; no issues spotted.refarch-gateway/src/main/resources/application-local.yml (1)
42-47
: Verify Spring Boot 3.4 property names
logging.structured.format.console
is new to Spring Boot 3.4-M* snapshots. If your build still targets 3.2/3.3, these keys will be ignored. Confirm the BOM/pom version before merging.refarch-gateway/src/main/resources/application.yml (1)
65-80
: Confirm compatibility of structured-logging properties with the chosen Spring Boot version
logging.structured.*
and thejson.stacktrace
sub-section are only available starting with Spring Boot 3.4 (currently milestone). If the project’s parent POM has not yet been upgraded, the configuration will be silently ignored and you’ll fall back to the default pattern layout.refarch-integrations/refarch-s3-integration/refarch-s3-integration-rest/refarch-s3-integration-rest-service/src/main/resources/application.yml (1)
48-63
: Verify property names introduced for Spring 3.4 structured loggingThe following keys are not part of Spring Boot 3.3/3.4 GA:
logging.structured.json.add.*
– current property islogging.structured.json.include
or...json.additional-field.*
logging.structured.json.stacktrace.root
– correct key islogging.structured.json.stacktrace.order
Incorrect keys are silently ignored, leaving the defaults active.
Cross-check against the Spring Boot release notes and adjust accordingly.
...cosys-integration/refarch-cosys-integration-example/src/main/resources/application-local.yml
Outdated
Show resolved
Hide resolved
...rch-dms-integration/refarch-dms-integration-example/src/main/resources/application-local.yml
Outdated
Show resolved
Hide resolved
...rch-dms-integration/refarch-dms-integration-example/src/main/resources/application-local.yml
Show resolved
Hide resolved
...email-integration/refarch-email-integration-example/src/main/resources/application-local.yml
Outdated
Show resolved
Hide resolved
...ntegration-rest/refarch-s3-integration-rest-service/src/main/resources/application-local.yml
Show resolved
Hide resolved
...h-s3-integration-rest/refarch-s3-integration-rest-service/src/main/resources/application.yml
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Pull Request
Changes
application-example.yml
toapplication-local.yml
for easier usageReference
Issue: #292
Checklist
Note: If some checklist items are not relevant for your PR, just remove them.
General
I have read the Contribution Guidelines (TBD)Code
Summary by CodeRabbit
New Features
Bug Fixes
Chores