我有一個sbt/scala項目,其中包括依賴項「ch.qos.logback」%「logback-classic」%「1.0.13」,幷包含一個logback.xml文件其內容在這裏:logback忽略我的logback.xml
<configuration debug="true">
<logger name="com.typesafe.sslconfig.ssl.ConfigSSLContextBuilder" level="ERROR"/>
<logger name="com.typesafe.sslconfig.ssl.AlgorithmChecker" level="ERROR"/>
<root level="ERROR">
<appender class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%d{ISO8601} | %-5level | %thread | %logger{1} | %m%n</pattern>
</encoder>
</appender>
</root>
</configuration>
https://pastebin.com/S1qauMi9
當我運行該程序,我在這裏得到的輸出:
[WARN] [07/05/2017 16:01:25.782] [main] [com.typesafe.sslconfig.ssl.ConfigSSLContextBuilder] validateStore: Skipping certificate with weak key size in thawtepremiumserverca: Certificate failed: cert = "1.2.840.113549.1.9.1=#16197072656d69756d2d736572766572407468617774652e636f6d,CN=Thawte Premium Server CA,OU=Certification Services Division,O=Thawte Consulting cc,L=Cape Town,ST=Western Cape,C=ZA" failed on constraint RSA keySize < 2048, algorithm = RSA, keySize = 1024
[WARN] [07/05/2017 16:01:25.782] [main] [com.typesafe.sslconfig.ssl.ConfigSSLContextBuilder] validateStore: Skipping certificate with weak key size in thawteserverca: Certificate failed: cert = "1.2.840.113549.1.9.1=#16177365727665722d6365727473407468617774652e636f6d,CN=Thawte Server CA,OU=Certification Services Division,O=Thawte Consulting cc,L=Cape Town,ST=Western Cape,C=ZA" failed on constraint RSA keySize < 2048, algorithm = RSA, keySize = 1024
...
16:01:25,822 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
16:01:25,822 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
16:01:25,822 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/Users/eswenson/Projects/Modulus/ws/modulus-shared-libraries/modules/dataset-client-cli/target/scala-2.11/dataset-client-cli-assembly-1.0.dev.jar!/logback.xml]
16:01:25,833 |-INFO in [email protected] - URL [jar:file:/Users/eswenson/Projects/Modulus/ws/modulus-shared-libraries/modules/dataset-client-cli/target/scala-2.11/dataset-client-cli-assembly-1.0.dev.jar!/logback.xml] is not of type file
16:01:25,873 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.typesafe.sslconfig.ssl.ConfigSSLContextBuilder] to ERROR
16:01:25,873 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.typesafe.sslconfig.ssl.AlgorithmChecker] to ERROR
16:01:25,873 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to ERROR
16:01:25,907 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
16:01:25,908 |-INFO in [email protected] - Registering current configuration as safe fallback point
[WARN] [07/05/2017 16:01:26.084] [main] [com.typesafe.sslconfig.ssl.ConfigSSLContextBuilder] validateStore: Skipping certificate with weak key size in thawtepremiumserverca: Certificate failed: cert = "1.2.840.113549.1.9.1=#16197072656d69756d2d736572766572407468617774652e636f6d,CN=Thawte Premium Server CA,OU=Certification Services Division,O=Thawte Consulting cc,L=Cape Town,ST=Western Cape,C=ZA" failed on constraint RSA keySize < 2048, algorithm = RSA, keySize = 1024
[WARN] [07/05/2017 16:01:26.085] [main] [com.typesafe.sslconfig.ssl.ConfigSSLContextBuilder] validateStore: Skipping certificate with weak key size in thawteserverca: Certificate failed: cert = "1.2.840.113549.1.9.1=#16177365727665722d6365727473407468617774652e636f6d,CN=Thawte Server CA,OU=Certification Services Division,O=Thawte Consulting cc,L=Cape Town,ST=Western Cape,C=ZA" failed on constraint RSA keySize < 2048, algorithm = RSA, keySize = 1024
Full log here: https://pastebin.com/6Xd10TZZ
兩個問題:
1)爲什麼有java日誌輸出BEFORE logback似乎正在配置?我如何確保首次初始化logback?
2)爲什麼所有來自com.typesafe.sslconfig.ssl.ConfigSSLContextBuilder的警告都會被記錄下來,當我明確地將這些警告設置爲ERROR時?
我已啓用logback配置調試,以便您可以看到logback確實聲稱將loglevel設置爲此類的ERROR。但仍然記錄消息。
更改爲此,並沒有幫助。仍然有完全相同的行爲: https://pastebin.com/2nGkB934 – eswenson
任何人有任何建議嗎? – eswenson