Skip to content

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

Merged
merged 5 commits into from
Jul 23, 2025

Conversation

devtobi
Copy link
Member

@devtobi devtobi commented Jul 23, 2025

Pull Request

Changes

  • Added support for colorful local log
  • Simplified JSON based logging via Spring structured logging support
  • Removed now unnecessary dependencies, test classes and logback configuration files
  • Added application groups to logging
  • Aligned application-example.yml to application-local.yml for easier usage

Reference

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)
  • Met all acceptance criteria of the issue
  • Added meaningful PR title and list of changes in the description

Code

  • Wrote code and comments in English

Summary by CodeRabbit

  • New Features

    • Enhanced application banners to display both application name and group.
    • Added application metadata (name, group, version) to configuration files for improved identification.
    • Improved logging configuration, including structured logging, stack trace length limits, and dynamic metadata in logs.
  • Bug Fixes

    • Adjusted logging levels and disabled unnecessary structured logging for local and test environments.
  • Chores

    • Removed Logstash Logback encoder dependencies and related configuration files.
    • Deleted obsolete example and test configuration files.
    • Removed test classes related to Logback JSON logging.

@devtobi devtobi linked an issue Jul 23, 2025 that may be closed by this pull request
2 tasks
Copy link
Contributor

coderabbitai bot commented Jul 23, 2025

"""

Walkthrough

This 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

Files/Paths Change Summary
refarch-gateway/pom.xml, refarch-integrations/pom.xml, .../refarch-s3-integration-rest-service/pom.xml Removed logstash-logback-encoder dependency and version property from Maven POM files.
refarch-gateway/src/main/resources/logback-spring.xml, .../refarch-s3-integration-rest-service/src/main/resources/logback-spring.xml Deleted Logback XML configuration files for logging.
refarch-gateway/src/main/resources/application.yml, .../refarch-s3-integration-rest-service/src/main/resources/application.yml Updated YAML configuration: added/updated spring.application metadata, structured logging, and log levels.
.../application-local.yml, .../application-test.yml, .../application-example.yml Added or updated local/test/example YAML configs for logging and application metadata.
refarch-gateway/src/main/resources/banner.txt, .../refarch-s3-integration-rest-service/src/main/resources/banner.txt Modified banner to include application group with application name.
refarch-gateway/src/test/java/de/muenchen/refarch/gateway/configuration/LogbackJsonLoggingTest.java, .../LogbackJsonLoggingTest.java Deleted test classes verifying JSON logging and stack trace behavior.
refarch-integrations/refarch-dms-integration/refarch-dms-integration-example/src/main/resources/application-example.yml Deleted example YAML configuration file for DMS integration.

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)
Loading

Estimated code review effort

2 (~15 minutes)

Poem

🐇
Goodbye to Logback XML,
YAML now rings the bell.
Application group in the banner,
Logs structured with new manner.
Old tests and encoders swept away,
Spring Boot logging, fresh today!
Hoppity hop, hooray!
"""


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b2487b1 and 0e31b16.

📒 Files selected for processing (6)
  • refarch-gateway/src/main/resources/application-local.yml (1 hunks)
  • refarch-gateway/src/main/resources/application.yml (2 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-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/src/main/resources/application.yml (2 hunks)
✅ Files skipped from review due to trivial changes (3)
  • refarch-integrations/refarch-cosys-integration/refarch-cosys-integration-example/src/main/resources/application-local.yml
  • refarch-integrations/refarch-email-integration/refarch-email-integration-example/src/main/resources/application-local.yml
  • refarch-gateway/src/main/resources/application-local.yml
🚧 Files skipped from review as they are similar to previous changes (3)
  • refarch-integrations/refarch-dms-integration/refarch-dms-integration-example/src/main/resources/application-local.yml
  • refarch-gateway/src/main/resources/application.yml
  • refarch-integrations/refarch-s3-integration/refarch-s3-integration-rest/refarch-s3-integration-rest-service/src/main/resources/application.yml
⏰ 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)
  • GitHub Check: codeql / Analyze Java source files (./refarch-gateway)
  • GitHub Check: codeql / Analyze Java source files (./refarch-tools/refarch-java-tools)
  • GitHub Check: codeql / Analyze Java source files (./refarch-integrations)
  • GitHub Check: build-maven

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added Component: API-Gateway Issues regarding the API Gateway Component: Integrations Issues regarding the Integrations Type: Maintenance The issue contains maintenance work. labels Jul 23, 2025
@devtobi devtobi marked this pull request as ready for review July 23, 2025 11:14
@devtobi devtobi requested a review from a team as a code owner July 23, 2025 11:14
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 placeholders

If 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 added spring.application.version in this file, not version). 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” if spring.application.group is unset

(${spring.application.group}) renders literally when spring.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

📥 Commits

Reviewing files that changed from the base of the PR and between 1c897fe and b2487b1.

📒 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 of logging.include-application-group property

I 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 key logging.include-application-group is supported

Spring 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 recognises logging.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 supports logging.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 the json.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 logging

The following keys are not part of Spring Boot 3.3/3.4 GA:

  • logging.structured.json.add.* – current property is logging.structured.json.include or ...json.additional-field.*
  • logging.structured.json.stacktrace.root – correct key is logging.structured.json.stacktrace.order

Incorrect keys are silently ignored, leaving the defaults active.
Cross-check against the Spring Boot release notes and adjust accordingly.

Copy link
Contributor

@DanielOber DanielOber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@devtobi devtobi merged commit 2f08123 into main Jul 23, 2025
18 checks passed
@devtobi devtobi deleted the maint/292-maintenance-leverage-spring-34-features branch July 23, 2025 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: API-Gateway Issues regarding the API Gateway Component: Integrations Issues regarding the Integrations Type: Maintenance The issue contains maintenance work.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Maintenance] Leverage Spring 3.4 Features
2 participants