Skip to content

Fix generated logback-spring.xml hiding WARN and INFO messages#15973

Merged
jdaugherty merged 1 commit into
apache:8.0.xfrom
codeconsole:fix/simplify-logback-spring-xml
Jul 11, 2026
Merged

Fix generated logback-spring.xml hiding WARN and INFO messages#15973
jdaugherty merged 1 commit into
apache:8.0.xfrom
codeconsole:fix/simplify-logback-spring-xml

Conversation

@codeconsole

Copy link
Copy Markdown
Contributor

Summary

The starter grails-app/conf/logback-spring.xml generated for new applications sets the root logger to ERROR, which suppresses the WARN and INFO output — including framework startup warnings — that Spring Boot shows by default.

This PR raises the root level to INFO and composes Spring Boot's own defaults.xml and console-appender.xml instead of duplicating the console appender, so the generated configuration matches Spring Boot's defaults. Jansi remains unused; Spring Boot's %clr converter supplies console colors (see #15663).

The change is applied to both generation paths so create-app and start.grails.org produce the same file:

  • Profile CLI: grails-profiles/base/skeleton/grails-app/conf/logback-spring.xml (also fixes the commented development logger example to use the @grails.codegen.defaultPackage@ placeholder instead of a hardcoded package name)
  • Grails Forge: grails-forge-core logback.rocker.raw template, with LogbackSpec updated to assert the new content

This is the logback-spring.xml portion of #15757, extracted into its own PR. The opt-in zero-config Forge feature and documentation changes remain in #15757.

Testing

  • Full grails-forge-core test suite passes, including the updated LogbackSpec assertions (Spring Boot includes present, INFO root level, development springProfile, no Jansi) across all application types.

The starter file set the root logger to ERROR, suppressing the WARN and
INFO output — including framework startup warnings — that Spring Boot
shows by default. Raise the root level to INFO and compose Spring Boot's
own defaults.xml and console-appender.xml instead of duplicating the
console appender, so the generated configuration matches Spring Boot's
defaults.

Applied to both generation paths: the Grails Forge template
(logback.rocker.raw) and the profile CLI base skeleton
(grails-profiles/base/skeleton), so create-app and start.grails.org
produce the same file. The commented development logger example in the
skeleton now uses the @grails.codegen.defaultPackage@ placeholder instead
of a hardcoded package name.
@testlens-app

testlens-app Bot commented Jul 11, 2026

Copy link
Copy Markdown

🚨 TestLens detected 8 failed tests 🚨

Here is what you can do:

  1. Inspect the test failures carefully.
  2. If you are convinced that some of the tests are flaky, you can mute them below.
  3. Finally, trigger a rerun by checking the rerun checkbox.

Test Summary

CI / Build Grails-Core (ubuntu-latest, 21) > :grails-datamapping-core:test

Test Runs Flakiness
WhereQueryClosureCaptureSpec > association criteria closures capture only the variables they reference 70% 🔴
WhereQueryClosureCaptureSpec > generated closure constructors are identical across compilations 70% 🔴

CI / Build Grails-Core (ubuntu-latest, 25) > :grails-datamapping-core:test

Test Runs Flakiness
WhereQueryClosureCaptureSpec > association criteria closures capture only the variables they reference 70% 🔴
WhereQueryClosureCaptureSpec > generated closure constructors are identical across compilations 70% 🔴

CI / Build Grails-Core (windows-latest, 25) > :grails-datamapping-core:test

Test Runs Flakiness
WhereQueryClosureCaptureSpec > association criteria closures capture only the variables they reference 70% 🔴
WhereQueryClosureCaptureSpec > generated closure constructors are identical across compilations 70% 🔴

CI / Build Grails-Core Rerunning all Tasks (ubuntu-latest, 21) > :grails-datamapping-core:test

Test Runs Flakiness
WhereQueryClosureCaptureSpec > association criteria closures capture only the variables they reference 70% 🔴
WhereQueryClosureCaptureSpec > generated closure constructors are identical across compilations 70% 🔴

🏷️ Commit: a5ef545
▶️ Tests: 48282 executed
🟡 Checks: 52/54 completed

Test Failures

WhereQueryClosureCaptureSpec > association criteria closures capture only the variables they reference (:grails-datamapping-core:test in CI / Build Grails-Core (ubuntu-latest, 21))
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
               bookId == bookId && author.name == authorName
               ^
Script_1df3bd51cd780ef3e360da6527072096.groovy: 8: Cannot query on property "bookId" - no such property on class Book exists.


               bookId == bookId && author.name == authorName
                                   ^
Script_1df3bd51cd780ef3e360da6527072096.groovy: 8: Cannot query property "author" - no such property on class Book exists.


2 errors

	at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:292)
	at org.codehaus.groovy.control.CompilationUnit$ISourceUnitOperation.doPhaseOperation(CompilationUnit.java:894)
	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:668)
	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:642)
	at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:399)
	at groovy.lang.GroovyClassLoader.lambda$parseClass$5(GroovyClassLoader.java:345)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:345)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:329)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:303)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:313)
	at org.grails.datastore.gorm.query.transform.WhereQueryClosureCaptureSpec.association criteria closures capture only the variables they reference(WhereQueryClosureCaptureSpec.groovy:61)
WhereQueryClosureCaptureSpec > generated closure constructors are identical across compilations (:grails-datamapping-core:test in CI / Build Grails-Core (ubuntu-latest, 21))
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
               bookId == bookId && author.name == authorName
               ^
Script_1df3bd51cd780ef3e360da6527072096.groovy: 8: Cannot query on property "bookId" - no such property on class Book exists.


               bookId == bookId && author.name == authorName
                                   ^
Script_1df3bd51cd780ef3e360da6527072096.groovy: 8: Cannot query property "author" - no such property on class Book exists.


2 errors

	at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:292)
	at org.codehaus.groovy.control.CompilationUnit$ISourceUnitOperation.doPhaseOperation(CompilationUnit.java:894)
	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:668)
	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:642)
	at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:399)
	at groovy.lang.GroovyClassLoader.lambda$parseClass$5(GroovyClassLoader.java:345)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:345)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:329)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:303)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:313)
	at org.grails.datastore.gorm.query.transform.WhereQueryClosureCaptureSpec.closureConstructorSignatures(WhereQueryClosureCaptureSpec.groovy:88)
	at org.grails.datastore.gorm.query.transform.WhereQueryClosureCaptureSpec.generated closure constructors are identical across compilations(WhereQueryClosureCaptureSpec.groovy:79)
WhereQueryClosureCaptureSpec > association criteria closures capture only the variables they reference (:grails-datamapping-core:test in CI / Build Grails-Core (ubuntu-latest, 25))
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
               bookId == bookId && author.name == authorName
               ^
Script_1df3bd51cd780ef3e360da6527072096.groovy: 8: Cannot query on property "bookId" - no such property on class Book exists.


               bookId == bookId && author.name == authorName
                                   ^
Script_1df3bd51cd780ef3e360da6527072096.groovy: 8: Cannot query property "author" - no such property on class Book exists.


2 errors

	at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:292)
	at org.codehaus.groovy.control.CompilationUnit$ISourceUnitOperation.doPhaseOperation(CompilationUnit.java:894)
	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:668)
	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:642)
	at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:399)
	at groovy.lang.GroovyClassLoader.lambda$parseClass$5(GroovyClassLoader.java:345)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:345)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:329)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:303)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:313)
	at org.grails.datastore.gorm.query.transform.WhereQueryClosureCaptureSpec.association criteria closures capture only the variables they reference(WhereQueryClosureCaptureSpec.groovy:61)
WhereQueryClosureCaptureSpec > generated closure constructors are identical across compilations (:grails-datamapping-core:test in CI / Build Grails-Core (ubuntu-latest, 25))
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
               bookId == bookId && author.name == authorName
               ^
Script_1df3bd51cd780ef3e360da6527072096.groovy: 8: Cannot query on property "bookId" - no such property on class Book exists.


               bookId == bookId && author.name == authorName
                                   ^
Script_1df3bd51cd780ef3e360da6527072096.groovy: 8: Cannot query property "author" - no such property on class Book exists.


2 errors

	at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:292)
	at org.codehaus.groovy.control.CompilationUnit$ISourceUnitOperation.doPhaseOperation(CompilationUnit.java:894)
	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:668)
	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:642)
	at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:399)
	at groovy.lang.GroovyClassLoader.lambda$parseClass$5(GroovyClassLoader.java:345)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:345)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:329)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:303)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:313)
	at org.grails.datastore.gorm.query.transform.WhereQueryClosureCaptureSpec.closureConstructorSignatures(WhereQueryClosureCaptureSpec.groovy:88)
	at org.grails.datastore.gorm.query.transform.WhereQueryClosureCaptureSpec.generated closure constructors are identical across compilations(WhereQueryClosureCaptureSpec.groovy:79)
WhereQueryClosureCaptureSpec > association criteria closures capture only the variables they reference (:grails-datamapping-core:test in CI / Build Grails-Core (windows-latest, 25))
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
               bookId == bookId && author.name == authorName
               ^
Script_1df3bd51cd780ef3e360da6527072096.groovy: 8: Cannot query on property "bookId" - no such property on class Book exists.


               bookId == bookId && author.name == authorName
                                   ^
Script_1df3bd51cd780ef3e360da6527072096.groovy: 8: Cannot query property "author" - no such property on class Book exists.


2 errors

	at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:292)
	at org.codehaus.groovy.control.CompilationUnit$ISourceUnitOperation.doPhaseOperation(CompilationUnit.java:894)
	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:668)
	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:642)
	at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:399)
	at groovy.lang.GroovyClassLoader.lambda$parseClass$5(GroovyClassLoader.java:345)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:345)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:329)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:303)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:313)
	at org.grails.datastore.gorm.query.transform.WhereQueryClosureCaptureSpec.association criteria closures capture only the variables they reference(WhereQueryClosureCaptureSpec.groovy:61)
WhereQueryClosureCaptureSpec > generated closure constructors are identical across compilations (:grails-datamapping-core:test in CI / Build Grails-Core (windows-latest, 25))
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
               bookId == bookId && author.name == authorName
               ^
Script_1df3bd51cd780ef3e360da6527072096.groovy: 8: Cannot query on property "bookId" - no such property on class Book exists.


               bookId == bookId && author.name == authorName
                                   ^
Script_1df3bd51cd780ef3e360da6527072096.groovy: 8: Cannot query property "author" - no such property on class Book exists.


2 errors

	at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:292)
	at org.codehaus.groovy.control.CompilationUnit$ISourceUnitOperation.doPhaseOperation(CompilationUnit.java:894)
	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:668)
	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:642)
	at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:399)
	at groovy.lang.GroovyClassLoader.lambda$parseClass$5(GroovyClassLoader.java:345)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:345)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:329)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:303)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:313)
	at org.grails.datastore.gorm.query.transform.WhereQueryClosureCaptureSpec.closureConstructorSignatures(WhereQueryClosureCaptureSpec.groovy:88)
	at org.grails.datastore.gorm.query.transform.WhereQueryClosureCaptureSpec.generated closure constructors are identical across compilations(WhereQueryClosureCaptureSpec.groovy:79)
WhereQueryClosureCaptureSpec > association criteria closures capture only the variables they reference (:grails-datamapping-core:test in CI / Build Grails-Core Rerunning all Tasks (ubuntu-latest, 21))
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
               bookId == bookId && author.name == authorName
               ^
Script_1df3bd51cd780ef3e360da6527072096.groovy: 8: Cannot query on property "bookId" - no such property on class Book exists.


               bookId == bookId && author.name == authorName
                                   ^
Script_1df3bd51cd780ef3e360da6527072096.groovy: 8: Cannot query property "author" - no such property on class Book exists.


2 errors

	at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:292)
	at org.codehaus.groovy.control.CompilationUnit$ISourceUnitOperation.doPhaseOperation(CompilationUnit.java:894)
	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:668)
	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:642)
	at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:399)
	at groovy.lang.GroovyClassLoader.lambda$parseClass$5(GroovyClassLoader.java:345)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:345)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:329)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:303)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:313)
	at org.grails.datastore.gorm.query.transform.WhereQueryClosureCaptureSpec.association criteria closures capture only the variables they reference(WhereQueryClosureCaptureSpec.groovy:61)
WhereQueryClosureCaptureSpec > generated closure constructors are identical across compilations (:grails-datamapping-core:test in CI / Build Grails-Core Rerunning all Tasks (ubuntu-latest, 21))
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
               bookId == bookId && author.name == authorName
               ^
Script_1df3bd51cd780ef3e360da6527072096.groovy: 8: Cannot query on property "bookId" - no such property on class Book exists.


               bookId == bookId && author.name == authorName
                                   ^
Script_1df3bd51cd780ef3e360da6527072096.groovy: 8: Cannot query property "author" - no such property on class Book exists.


2 errors

	at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:292)
	at org.codehaus.groovy.control.CompilationUnit$ISourceUnitOperation.doPhaseOperation(CompilationUnit.java:894)
	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:668)
	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:642)
	at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:399)
	at groovy.lang.GroovyClassLoader.lambda$parseClass$5(GroovyClassLoader.java:345)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:345)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:329)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:303)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:313)
	at org.grails.datastore.gorm.query.transform.WhereQueryClosureCaptureSpec.closureConstructorSignatures(WhereQueryClosureCaptureSpec.groovy:88)
	at org.grails.datastore.gorm.query.transform.WhereQueryClosureCaptureSpec.generated closure constructors are identical across compilations(WhereQueryClosureCaptureSpec.groovy:79)

Muted Tests

Note

Checks are currently running using the configuration below.

Select tests to mute in this pull request:

🔲 WhereQueryClosureCaptureSpec > association criteria closures capture only the variables they reference
🔲 WhereQueryClosureCaptureSpec > generated closure constructors are identical across compilations

Reuse successful test results:

🔲 ♻️ Only rerun the tests that failed or were muted before

Click the checkbox to trigger a rerun:

🔲 Rerun jobs


Learn more about TestLens at testlens.app.

@codecov

codecov Bot commented Jul 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 19.5852%. Comparing base (d090ded) to head (a5ef545).

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##                8.0.x     #15973   +/-   ##
=============================================
  Coverage     19.5852%   19.5852%           
  Complexity        308        308           
=============================================
  Files              61         61           
  Lines            3472       3472           
  Branches          601        601           
=============================================
  Hits              680        680           
  Misses           2662       2662           
  Partials          130        130           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jdaugherty

Copy link
Copy Markdown
Contributor

@jamesfredley I am merging this to ensure log output for the M3. If you still disagree with any if this, lets fix in a subsequent PR?

@jdaugherty jdaugherty merged commit f69ce63 into apache:8.0.x Jul 11, 2026
52 of 57 checks passed
codeconsole added a commit to codeconsole/grails-core that referenced this pull request Jul 11, 2026
…figuration feature

With the generated file's content fixes landed separately in apache#15973
(simplified to compose Spring Boot's defaults with an INFO root level),
flip this PR back to its original intent: newly generated applications
ship no logback-spring.xml at all.

- Profile skeleton: remove grails-app/conf/logback-spring.xml.
- Forge: the default logback feature only adds the grails-logging
  dependency; Spring Boot's zero-config Logback defaults apply. A new
  visible logback-config feature (Logback Configuration) generates the
  simplified starter file on demand and supersedes the default feature.
- Docs: the logging reference and upgrade guide describe zero-config
  logging as the default for new applications, application.yml level
  tuning (including per-environment via the environments block), when to
  add logback-spring.xml, and the boundaries between the two modes.
- Tests: LogbackSpec asserts no file is generated by default and that
  logback-config emits the simplified configuration with grails-logging
  declared exactly once.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants