为什么 Logback 是 Spring Boot 中的默认日志记录框架?
Why is Logback the default logging framework in Spring Boot?
我尝试搜索 Spring 文档 + 互联网上的文章 + 来自 Whosebug 的问题,但我没有找到任何相关信息。
对我来说Log4J2的配置(尤其是pattern)就简单多了,个人口味。
此外,根据这些文章,我发现 Log4J2 的性能优于 Logback:
https://stackify.com/compare-java-logging-frameworks
https://blog.overops.com/the-logging-olympics-a-race-between-todays-top-5-logging-frameworks
https://www.sitepoint.com/which-java-logging-framework-has-the-best-performance/
如果我们要考虑 Async Logger,根据 Apache 的说法,Log4J2 的性能更高 - https://logging.apache.org/log4j/2.x/performance.html 是的,我知道让他们的框架看起来更好是他们的工作,但我相信他们是可靠的。
我的假设是 Pivotal 选择 Logback 作为默认设置,因为 Log4J2 在他们发布 Spring-Boot.
1.0 版后的某个时候出现了
任何人都可以阐明这一点吗?
我的假设正确吗?
这是原因:
Phil Webb: I don't really feel like the arguments being made justify the introduction of a breaking change. [...] If we were
starting Spring Boot today we may well have chosen Log4J2 over
Logback, but I think so far there are no massively compelling reasons
to cause our users upgrade pain. [...] I think it's unlikely that
we'll consider switching the default logging system until the next
major release of Spring Boot.
Ralph Goers: support for configuring Log4j 2 from Spring Cloud Config is planned to be added.
Log4j 2.12.0 添加了对利用 Spring Cloud Config 托管具有动态重新配置的 Log4j 配置的支持,并添加了对 Docker 的支持。随着 Log4j 2.13.0 的发布,Log4j 通过提供 Spring 查找进一步与 Spring 集成,因此 Log4j 配置可以访问 spring 属性。此外,一些 Log4j 系统属性也可以从 Spring 的 bootstrap.yml 或 application.yml 文件中读取。 2.13.0 还提供了一个 Kubernetes 查找,允许在 Log4j 配置中将 Kubernetes 属性指定为要包含在日志事件中的属性。
我尝试搜索 Spring 文档 + 互联网上的文章 + 来自 Whosebug 的问题,但我没有找到任何相关信息。 对我来说Log4J2的配置(尤其是pattern)就简单多了,个人口味。
此外,根据这些文章,我发现 Log4J2 的性能优于 Logback:
https://stackify.com/compare-java-logging-frameworks
https://blog.overops.com/the-logging-olympics-a-race-between-todays-top-5-logging-frameworks
https://www.sitepoint.com/which-java-logging-framework-has-the-best-performance/
如果我们要考虑 Async Logger,根据 Apache 的说法,Log4J2 的性能更高 - https://logging.apache.org/log4j/2.x/performance.html 是的,我知道让他们的框架看起来更好是他们的工作,但我相信他们是可靠的。
我的假设是 Pivotal 选择 Logback 作为默认设置,因为 Log4J2 在他们发布 Spring-Boot.
1.0 版后的某个时候出现了任何人都可以阐明这一点吗? 我的假设正确吗?
这是原因:
Phil Webb: I don't really feel like the arguments being made justify the introduction of a breaking change. [...] If we were starting Spring Boot today we may well have chosen Log4J2 over Logback, but I think so far there are no massively compelling reasons to cause our users upgrade pain. [...] I think it's unlikely that we'll consider switching the default logging system until the next major release of Spring Boot.
Ralph Goers: support for configuring Log4j 2 from Spring Cloud Config is planned to be added.
Log4j 2.12.0 添加了对利用 Spring Cloud Config 托管具有动态重新配置的 Log4j 配置的支持,并添加了对 Docker 的支持。随着 Log4j 2.13.0 的发布,Log4j 通过提供 Spring 查找进一步与 Spring 集成,因此 Log4j 配置可以访问 spring 属性。此外,一些 Log4j 系统属性也可以从 Spring 的 bootstrap.yml 或 application.yml 文件中读取。 2.13.0 还提供了一个 Kubernetes 查找,允许在 Log4j 配置中将 Kubernetes 属性指定为要包含在日志事件中的属性。