I found the problem with Spring Boot 3.5.7 and the New Relic agent. Spring Boot version 3.5.7 brings Logback 1.5.20, which was previously not supported by the New Relic agent. They released a new version with Logback 1.5.20 support (Java agent v8.25.0 - https://docs.newrelic.com/docs/release-notes/agent-release-notes/java-release-notes/java-agent-8250/). I updated the New Relic agent to this version and the logs are working correctly.