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

How to support logback-spring.xml #573

Closed
l10178 opened this issue Sep 29, 2022 · 4 comments
Closed

How to support logback-spring.xml #573

l10178 opened this issue Sep 29, 2022 · 4 comments
Assignees
Labels
document question Further information is requested

Comments

@l10178
Copy link

l10178 commented Sep 29, 2022

Describe the bug

根据官方sofa-ark-spring-guides和spring-boot-ark-biz两个例子可复现此问题。

使用sofa-ark-spring-guides作为master biz以java -jar -Dsofa.ark.embed.enable=true方式启动,然后telnet install spring-boot-ark-biz,问题表现为spring-boot-ark-biz无日志输出。

实际上是因为我在spring-boot-ark-biz的resources目录下放了一个logback-spring.xml,如果去掉此文件只在application.properties里配置日志相关参数,或者把logback-spring.xml改为logback.xml,日志都能正常工作。

Environment

  • SOFAArk version: 2.0.4
  • JVM version : java 11
@sofastack-bot sofastack-bot bot added the question Further information is requested label Sep 29, 2022
@gaosaroma
Copy link
Collaborator

因为demo中biz使用的LoggerContext是宿主应用的LoggerContext(使用宿主的类加载器加载的),所以会认为已经被初始化过了,从而不会读取logback-spring.xml。一般而言,建议biz模块使用application.properties配置日志参数。

@l10178
Copy link
Author

l10178 commented Nov 18, 2022

希望将这个说明放到文档里。

@lylingzhen
Copy link
Contributor

@gaosaroma 把这个放到文档里吧。

@gaosaroma
Copy link
Collaborator

已加入文档 sofastack/sofastack.tech#1185

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
document question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants