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

Logback 自动搜索并引用包中未配置的 logback.xml #27

Open
xJoeWoo opened this issue May 10, 2020 · 0 comments
Open

Logback 自动搜索并引用包中未配置的 logback.xml #27

xJoeWoo opened this issue May 10, 2020 · 0 comments

Comments

@xJoeWoo
Copy link

xJoeWoo commented May 10, 2020

使用 Spring Boot 2.0 从 Gradle 引入该库,且未在项目中配置 logback.xml (如单元测试时)的时候,会自动引入包中的 logback.xml。又因这个文件是样板文件尚未被正确配置,会造成报错:

2:53:06,194 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/xxx/.gradle/caches/modules-2/files-2.1/com.aliyun.openservices/aliyun-log-logback-appender/0.1.16/bfd55f2db8acd25219b6e3a9939bd43e96ade9e9/aliyun-log-logback-appender-0.1.16.jar!/logback.xml]
12:53:06,202 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@295cf707 - URL [jar:file:/C:/Users/xjoew/.gradle/caches/modules-2/files-2.1/com.aliyun.openservices/aliyun-log-logback-appender/0.1.16/bfd55f2db8acd25219b6e3a9939bd43e96ade9e9/aliyun-log-logback-appender-0.1.16.jar!/logback.xml] is not of type file
12:53:06,311 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
12:53:06,314 |-INFO in ch.qos.logback.core.joran.action.ShutdownHookAction - About to instantiate shutdown hook of type [ch.qos.logback.core.hook.DelayingShutdownHook]
12:53:06,321 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [com.aliyun.openservices.log.logback.LoghubAppender]
12:53:06,335 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [loghubAppender1]
12:53:06,371 |-ERROR in com.aliyun.openservices.log.logback.LoghubAppender[loghubAppender1] - Failed to start LoghubAppender. java.lang.NullPointerException: endpoint cannot be null
	at java.lang.NullPointerException: endpoint cannot be null
	at 	at com.aliyun.openservices.aliyun.log.producer.ProjectConfig.<init>(ProjectConfig.java:48)
	at 	at com.aliyun.openservices.log.logback.LoghubAppender.buildProjectConfig(LoghubAppender.java:93)
	at 	at com.aliyun.openservices.log.logback.LoghubAppender.createProducer(LoghubAppender.java:86)
	at 	at com.aliyun.openservices.log.logback.LoghubAppender.doStart(LoghubAppender.java:81)
	at 	at com.aliyun.openservices.log.logback.LoghubAppender.start(LoghubAppender.java:69)
	at 	at ch.qos.logback.core.joran.action.AppenderAction.end(AppenderAction.java:90)

能否将此文件重命名为不能被自动搜索到的文件名,或放在 test 模块中,又或者在构建的时候不将此文件打包?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant