gpt4 book ai didi

tomcat - 在 Tomcat 7 下更改 Apache Jackrabbit 的日志级别

转载 作者:行者123 更新时间:2023-11-28 23:39:33 25 4
gpt4 key购买 nike

我正在尝试查看在 Tomcat 7 下运行的 Apache Jackrabbit 2.7.X 的 INFO 或 DEBUG 级日志消息。我搜索了一段时间,发现了两种不同的方法:

  • 添加具有适当配置的 WEB-INF/log4j.xml 文件
  • 设置 Java 级别的属性,例如log4j.logger.org.apache.jackrabbit

这似乎是一项简单的任务,但到目前为止,我还无法完成上述任何一项工作。

我对看到一些“内部结构”特别感兴趣,例如哪些数据是通过网络接收的,哪些是在存储库中创建的,等等。我什至不知道这是否可行,但我认为记录所有内容是一个很好的起点。

最佳答案

发布后大约 10 分钟,我找到了答案,所以这里是为了防止有人试图做同样的事情并在以后找到它。

虽然文档说:

Are there any notable log entries? Check the log files for any related warnings or errors. By default the Jackrabbit JCR Server writes log entries to the standard output of the servlet container. You can customize logging by editing the /WEB-INF/log4j.xml file and redeploying this web application.

这似乎是不正确的,因为实际上较新的 Jackrabbit 使用的是 logback,标准发行版中的配置文件是:

 WEB-INF/classes/logback.xml

您可以在其中更改基本级别并附加到控制台:

  <root level="DEBUG">
<appender-ref ref="console"/>
</root>

看来,您可以从那里获得更高级的东西。进行更改,重新启动容器,一切顺利。

关于tomcat - 在 Tomcat 7 下更改 Apache Jackrabbit 的日志级别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21369148/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com