gpt4 book ai didi

jsp - Tomcat 8 启用调试日志记录以列出不需要的 jar

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

在 Arch Linux ARM 上启动 Tomcat 8 时,我收到以下警告:

INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.`

我已经像这里描述的那样修改了 ${catalina.home}/logging.properties:How to fix JSP compiler warning: one JAR was scanned for TLDs yet contained no TLDs?

我将一些日志记录级别从 INFO 更改为 FINE,取消注释“org.apache.jasper.compiler.TldLocationsCache.level = FINE”并添加“org.apache.jasper.servlet.TldScanner.level = FINE”。所以文件的结尾现在看起来如下:

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = FINE org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers = 2localhost.org.apache.juli.AsyncFileHandler

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].level = FINE org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers = 3manager.org.apache.juli.AsyncFileHandler

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].level = FINE org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].handlers = 4host-manager.org.apache.juli.AsyncFileHandler

# For example, set the org.apache.catalina.util.LifecycleBase logger to log # each component that extends LifecycleBase changing state: #org.apache.catalina.util.LifecycleBase.level = FINE

# To see debug messages in TldLocationsCache, uncomment the following line: org.apache.jasper.compiler.TldLocationsCache.level = FINE org.apache.jasper.servlet.TldScanner.level = FINE

但我仍然在启动时收到警告,而不是不需要的 JAR 路径。怎么了?

最佳答案

尝试通过以下方式调试所有内容:

  1. 将此添加到位于 {CATALINA-HOME}/conf 中的 logging.properties 文件的末尾:

    #To see the most detailed level of logging for all classes, uncomment the following line:
    org.apache.catalina.level=FINEST
  2. 重启Tomcat

  3. 从终端运行以下命令以获取需要跳过的 jar 列表(由@joseph-lust 在 this 上提供):

    egrep "No TLD files were found in \[file:[^\]+\]" {CATALINA-HOME}/logs/catalina.out -o | egrep "[^]/]+.jar" -o | sort | uniq | sed -e 's/.jar/.jar,\\/g' > ~/skips.txt
  4. 在您的用户主目录中打开 skips.txt

  5. 将此列表添加到 {CATALINA-HOME}/conf/catalina.properties 以下行之后:

    org.apache.catalina.startup.TldConfig.jarsToSkip=
  6. 确保在完成后删除/注释掉它,以防止日志文件变得太大

我仍然不确定为什么会发生这种情况,因为取消对 TldLocationsCache 行的注释似乎对大多数人都有效。

关于jsp - Tomcat 8 启用调试日志记录以列出不需要的 jar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31242968/

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