我有一个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