You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@grails.apache.org by "jamesfredley (via GitHub)" <gi...@apache.org> on 2026/07/17 17:52:28 UTC
[PR] Document Spring Boot structured logging [grails-core]
jamesfredley opened a new pull request, #15997:
URL: https://github.com/apache/grails-core/pull/15997
## Summary
- document opt-in Spring Boot 4.1 structured logging in the logging guide
- cover console/file formats (ecs, gelf, logstash), JSON include/exclude/rename/add and stacktrace controls, MDC and SLF4J fluent key-values
- clarify the tracing/baggage correlation boundary and that Grails does not enable structured logging by default
## Verification
- :grails-doc:publishGuide -x aggregateGroovydoc
- git diff --check
This is an AI-generated starting point for documenting structured logging.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Document Spring Boot structured logging [grails-core]
Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #15997:
URL: https://github.com/apache/grails-core/pull/15997#issuecomment-5007693553
## ✅ All tests passed ✅
🏷️ Commit: e2ee9746eef7d5578ea09fe926393e4cdd642f49
▶️ Tests: 4221 executed
⚪️ Checks: 59/59 completed
---
_Learn more about TestLens at [testlens.app](https://testlens.app)._
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Document Spring Boot structured logging [grails-core]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #15997:
URL: https://github.com/apache/grails-core/pull/15997#discussion_r3605144302
##########
grails-doc/src/en/guide/conf/config/logging.adoc:
##########
@@ -30,3 +30,73 @@ NOTE: The filename `logback.xml` still works but `logback-spring.xml` is now rec
More information can be found in the official https://logback.qos.ch/documentation.html[Logback documentation].
+=== Structured Logging
+
+Grails does not enable structured logging. Existing Logback configuration and plain-text output remain unchanged
+unless an application explicitly selects a Spring Boot structured format. Spring Boot 4.1 provides the JSON format
+IDs `ecs` (Elastic Common Schema), `gelf` (Graylog Extended Log Format), and `logstash` for console and file output.
+For the complete reference, see the https://docs.spring.io/spring-boot/4.1/reference/features/logging.html#features.logging.structured[Spring Boot structured logging documentation].
+
+Configure the console and file outputs independently in `grails-app/conf/application.yml`:
+
+[source,yaml]
+.grails-app/conf/application.yml
+----
+logging:
+ structured:
+ format:
+ console: ecs
+ file: logstash
+ json:
+ exclude: process.id
Review Comment:
The example uses `process.id`, but Spring Boot’s structured JSON field for the process identifier is `process.pid`. As written, `logging.structured.json.exclude: process.id` won’t match anything and can mislead readers.
##########
grails-doc/src/en/guide/conf/config/logging.adoc:
##########
@@ -30,3 +30,73 @@ NOTE: The filename `logback.xml` still works but `logback-spring.xml` is now rec
More information can be found in the official https://logback.qos.ch/documentation.html[Logback documentation].
+=== Structured Logging
+
+Grails does not enable structured logging. Existing Logback configuration and plain-text output remain unchanged
+unless an application explicitly selects a Spring Boot structured format. Spring Boot 4.1 provides the JSON format
+IDs `ecs` (Elastic Common Schema), `gelf` (Graylog Extended Log Format), and `logstash` for console and file output.
+For the complete reference, see the https://docs.spring.io/spring-boot/4.1/reference/features/logging.html#features.logging.structured[Spring Boot structured logging documentation].
Review Comment:
This link hard-codes the Spring Boot `4.1` docs path, while other links in this file use the versionless `/spring-boot/reference/...` form. Hard-coding the version will go stale when Grails updates its Spring Boot baseline.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Document Spring Boot structured logging [grails-core]
Posted by "jamesfredley (via GitHub)" <gi...@apache.org>.
jamesfredley merged PR #15997:
URL: https://github.com/apache/grails-core/pull/15997
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Document Spring Boot structured logging [grails-core]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #15997:
URL: https://github.com/apache/grails-core/pull/15997#issuecomment-5006252660
## [Codecov](https://app.codecov.io/gh/apache/grails-core/pull/15997?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 51.1158%. Comparing base ([`b980413`](https://app.codecov.io/gh/apache/grails-core/commit/b980413820757347744aa6c10c44d7103babea39?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`136f16d`](https://app.codecov.io/gh/apache/grails-core/commit/136f16d7d103fe16bbaba04e546fb8bc2f254bcf?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
<details><summary>Additional details and impacted files</summary>
[](https://app.codecov.io/gh/apache/grails-core/pull/15997?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## 8.0.x #15997 +/- ##
================================================
+ Coverage 0 51.1158% +51.1158%
- Complexity 0 17599 +17599
================================================
Files 0 2041 +2041
Lines 0 95493 +95493
Branches 0 16587 +16587
================================================
+ Hits 0 48812 +48812
- Misses 0 39394 +39394
- Partials 0 7287 +7287
```
[see 2041 files with indirect coverage changes](https://app.codecov.io/gh/apache/grails-core/pull/15997/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
</details>
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Document Spring Boot structured logging [grails-core]
Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #15997:
URL: https://github.com/apache/grails-core/pull/15997#issuecomment-5006854367
## ✅ All tests passed ✅
🏷️ Commit: 136f16d7d103fe16bbaba04e546fb8bc2f254bcf
▶️ Tests: 27090 executed
⚪️ Checks: 60/60 completed
---
_Learn more about TestLens at [testlens.app](https://testlens.app)._
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Document Spring Boot structured logging [grails-core]
Posted by "davydotcom (via GitHub)" <gi...@apache.org>.
davydotcom commented on code in PR #15997:
URL: https://github.com/apache/grails-core/pull/15997#discussion_r3605887035
##########
grails-doc/src/en/guide/conf/config/logging.adoc:
##########
@@ -30,3 +30,73 @@ NOTE: The filename `logback.xml` still works but `logback-spring.xml` is now rec
More information can be found in the official https://logback.qos.ch/documentation.html[Logback documentation].
+=== Structured Logging
+
+Grails does not enable structured logging. Existing Logback configuration and plain-text output remain unchanged
+unless an application explicitly selects a Spring Boot structured format. Spring Boot 4.1 provides the JSON format
+IDs `ecs` (Elastic Common Schema), `gelf` (Graylog Extended Log Format), and `logstash` for console and file output.
+For the complete reference, see the https://docs.spring.io/spring-boot/4.1/reference/features/logging.html#features.logging.structured[Spring Boot structured logging documentation].
+
+Configure the console and file outputs independently in `grails-app/conf/application.yml`:
+
+[source,yaml]
+.grails-app/conf/application.yml
+----
+logging:
+ structured:
+ format:
+ console: ecs
+ file: logstash
+ json:
+ exclude: process.id
Review Comment:
confirmed this was true
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org