Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify Logback XML #16901

Closed
wants to merge 1 commit into from
Closed

Clarify Logback XML #16901

wants to merge 1 commit into from

Conversation

michaldo
Copy link
Contributor

Simple logging setup is configurable by application properties.

"To configure the more fine-grained settings of a logging system, you
need to use the native configuration format supported by the
LoggingSystem in question"

In other words Spring Boot provides default logging configuration +
application properties to modify. If application has to customize
something not covered by application properties, it must switch to XML
configuration.

Unfortunately, naive switching to XML cause lost default Spring Boot
configuration.

But there is an impression, that the lost can be avoided. It is possible
tweak low level logging detail by XML and keep default Spring Boot
configuration working. It is enough to import files 'base.xml' or
'default.xml'.

The impression is wrong.

'defaults.xml' does not setup console nor file logging, just setup
levels and properties.

'base.xml' by default logs to file '/tmp/spring.log', what is different
than default behavior that nothing is logged to a file.

Intention of my commit is to express that files 'base.xml' and
'defaults.xml' are not equivalent of default Spring Boot configuration

Simple logging setup is configurable by application properties.

"To configure the more fine-grained settings of a logging system, you
need to use the native configuration format supported by the
LoggingSystem in question"

In other words Spring Boot provides default logging configuration +
application properties to modify. If application has to customize
something not covered by application properties, it must switch to XML
configuration.

Unfortunately, naive switching to XML cause lost default Spring Boot
configuration.

But there is an impression, that the lost can be avoided. It is possible
tweak low level logging detail by XML and keep default Spring Boot
configuration working. It is enough to import files 'base.xml' or
'default.xml'.

The impression is wrong.

'defaults.xml' does not setup console nor file logging, just setup
levels and properties.

'base.xml' by default logs to file '/tmp/spring.log', what is different
than default behavior that nothing is logged to a file.

Intention of my commit is to express that files 'base.xml' and
'defaults.xml' are not equivalent of default Spring Boot configuration
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 19, 2019
@michaldo
Copy link
Contributor Author

@philwebb philwebb added for: merge-with-amendments Needs some changes when we merge type: documentation A documentation update and removed status: waiting-for-triage An issue we've not yet triaged labels May 22, 2019
@philwebb philwebb added this to the 2.1.x milestone May 22, 2019
@philwebb
Copy link
Member

I agree that that section is a little confusing. I think we ideally need to go a little further than your suggested edits and describe clearly the difference between base.xml and default.xml.

@philwebb philwebb mentioned this pull request Sep 4, 2019
philwebb pushed a commit that referenced this pull request Sep 4, 2019
Update documentation and comments on Logback to show the correct
use of `default.xml` rather than `base.xml`.

See gh-16901
philwebb added a commit that referenced this pull request Sep 4, 2019
Expand the Logback "How To" to provide further clarifications on
the different include files available.

See gh-16901
@philwebb philwebb closed this in 827c624 Sep 4, 2019
@philwebb philwebb modified the milestones: 2.1.x, 2.1.8 Sep 4, 2019
@philwebb
Copy link
Member

philwebb commented Sep 4, 2019

Thanks very much for the PR @michaldo. This is now in 2.1.x and 2.2.x. I've also extended the documentation a little to try and clarify when the different include files should be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: merge-with-amendments Needs some changes when we merge type: documentation A documentation update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants