After reading https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#features.logging, I am not sure how Spring handles logback by default. - Does it parse internally those importable org/springframework/boot/logging/logback/ files by default or does it just provide them for you to use them if you want to log like Spring and configures otherwise the logic programatically? - What happens if both logging.level. properties are used while providing a logback.xml (that has same capability) on your classpath? - How does Spring manage to avoid config contamination with the other potentially pulled dependencies that might contain logback files? (I know one might say the same about application.properties, but this happens to be present in the very same project on 99% of cases, unlike logback)

Comment From: snicoll

Spring Boot will provide a default logging format, as described in this section, that can be overwritten by a dedicated configuration. If you decide to use a custom logging configuration, you'll see there is a way to import a base and therefore reuse some of the things we do. At the end of this section, there is a link for each logging system. The Logback links to this.

logging.level are set with whatever logging system you've configured. The section starts with:

All the supported logging systems can have the logger levels set in the Spring Environment

We don't handle config contamination and we shouldn't. Having a library shipping by mistake a logging configuration is not something that specific to Spring Boot and can happen with plain java and only logback.

The title of your issue mentions suggestion and all I can see are questions. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements. If the above makes you think about improvements in that section I'd love to hear them. Better yet, a PR that we can review. Thank you.

Comment From: nightswimmings

Hi @snicoll ! Thanks! I'll ask in gitter, but I find the questions really fundamental and unanswered in documentation TBH. It would help to know if Spring default logging format is actually using the exact files it provides for extension (default.xml, console-appender.xml) or they are just the logback equivalent to Spring programatic configuration, and what is the priority when both logger.level directives and <logger> directives are used. And perhaps a more explicit warning about the possibility of dependencies logbacks being read (even if it's obvious). But it is just my opinion, no problem!

Comment From: wilkinsona

Thanks for the suggestions. We have to strike a balance with the reference documentation as we don't want to overwhelm readers with too much detail that has only a limited chance of being relevant to them.

It would help to know if Spring default logging format is actually using the exact files it provides for extension (default.xml, console-appender.xml) or they are just the logback equivalent to Spring programatic configuration

This is rather low-level so I don't think detail about this belongs in the reference documentation.

And perhaps a more explicit warning about the possibility of dependencies logbacks being read (even if it's obvious)

I don't think this warrants an explicit warning. We note that logback.xml is loaded from the classpath so the standard classpath first-wins behaviour applies. There's also nothing Spring Boot specific about this as it's Logback's default behaviour too.

If you'd like to understand things at a lower level where you're getting down into implementation details, reading the code is the best approach to take.