borinquenkid commented on PR #16067:
URL: https://github.com/apache/grails-core/pull/16067#issuecomment-5124511282

   Thanks for the correction and for pushing this further -- addressed all 
three points:
   
   **1. Diagnosis corrected** -- updated the PR description to point at the 
actual trigger (`grails-core`'s `logback-test.xml` shipping `root 
level=\"WARN\"` with zero appenders, so the event goes nowhere, not merely 
\"routed away from System.err\"). Good catch on `GrailsExceptionResolverSpec` 
being the control case that proves it.
   
   **2. Rebased** onto current `8.0.x` past #16011's merge. Kept 
`STACK_LOG_NAME` over the string literal in the two already-landed specs.
   
   **3. `GrailsExceptionResolverSpec` converted** -- all three `System.setErr` 
sites now use `LogCapture` (one keyed on `GrailsExceptionResolver`, one on 
`DefaultStackTraceFilterer.STACK_LOG_NAME`). The combined test that used to 
count substrings in rendered console output (including the brittle `'ERROR 
StackTrace '` layout match) now inspects each captured `ILoggingEvent`'s 
`throwableProxy` stack frames directly. This required swapping the module's 
test logging binding from `slf4j-simple` to `grails-core`'s test fixtures 
(transitively brings `logback-classic`, which `LogCapture` needs to attach a 
real Logback `Logger`) -- verified no other test in the module depended on 
`slf4j-simple` specifically.
   
   Held off on rolling the deterministic `logback-test.xml` out to 
`grails-web-mvc` itself (your point 3) -- `LogCapture` forces the target 
logger's own level to `TRACE` and attaches its own appender directly, so the 
module's tests are now independent of root logger config either way, and adding 
that file felt like a separate, broader change (affects visible output for 
every test in the module, not just these). Happy to do it here too if you'd 
rather bundle it.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to