【问题标题】:Jetty 9.4.9 ignoring jetty-logging.propertiesJetty 9.4.9 忽略 jetty-logging.properties
【发布时间】:2023-03-23 09:45:01
【问题描述】:

我在 CentOS 上使用 jetty 9.4.9 部署了一个 java webapp。除了我无法正常工作外,一切正常。我希望 StdErrLog 捕获我在https://www.eclipse.org/jetty/documentation/9.4.x/default-logging-with-stderrlog.html 中描述的所有日志记录,但需要进行一些调整,例如按日志级别过滤。

我通过以下方式添加了控制台捕获和码头日志记录:

java -jar /opt/jetty/start.jar --add-to-start=console-capture

java -jar /opt/jetty/start.jar --add-to-start=logging-jetty

我确实在 logs/2018_12_20.jetty.log 中看到了一个日志文件,但似乎没有包含 resources/jetty-logging.properties。至少我认为不是,因为它没有按要求过滤日志记录。当我添加乱码行时,码头也不会输出任何错误。

内容 jetty-logging.properties:

org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog

org.eclipse.jetty.LEVEL=INFO

ca.uhn.fhir.LEVEL=INFO

我仍然在日志中看到:

13:45:34.190 [qtp2051450519-10] DEBUG ca.uhn.fhir.context.ModelScanner - Scanning resource class: org.hl7.fhir.dstu3.model.Bundle

ca.uhn.fhir.LEVEL=INFO 似乎被忽略了。

【问题讨论】:

    标签: logging jetty


    【解决方案1】:

    ca.uhn.fhir.context.ModelScanner 类永远不会通过 Jetty 日志记录框架进行处理。

    您看到的日志输出来自其他日志库,该库正在向 STDERR 和/或 STDOUT 生成日志事件。

    输出的格式也是一个迹象,表明这是您正在处理的另一个(非 Jetty)日志框架。

    console-capture 模块的使用只是捕获任何进入 STDERR/STDOUT 的内容并写入文件。

    【讨论】:

      猜你喜欢
      • 2014-09-18
      • 1970-01-01
      • 2018-10-05
      • 1970-01-01
      • 2011-06-26
      • 2012-11-23
      • 2013-08-17
      • 2011-03-01
      • 1970-01-01
      相关资源
      最近更新 更多