Tomcat 8启用调试日志记录以列出不需要的jar [英] Tomcat 8 enable debug logging to list unneeded jars

查看:528
本文介绍了Tomcat 8启用调试日志记录以列出不需要的jar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Arch Linux ARM上启动Tomcat 8时,出现以下警告:

When starting Tomcat 8 on Arch Linux ARM I get the following warning:

信息:至少对一个JAR进行了TLD扫描,但不包含TLD. 为该记录器启用调试日志记录以获取完整的JAR列表 已被扫描,但未在其中找到TLD.跳过不需要的JAR 扫描期间可以缩短启动时间和JSP编译时间.

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,如此处所述:

I already modified ${catalina.home}/logging.properties like described here: 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".因此,文件的结尾现在看起来如下:

I changed some logging levels from INFO to FINE, uncommented "org.apache.jasper.compiler.TldLocationsCache.level = FINE" and added "org.apache.jasper.servlet.TldScanner.level = FINE". So the end of the file now looks the following:

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

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].[/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

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

#例如,将org.apache.catalina.util.LifecycleBase记录器设置为log #扩展LifecycleBase更改状态的每个组件: #org.apache.catalina.util.LifecycleBase.level =精细

# 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

#要查看TldLocationsCache中的调试消息,请取消注释以下行:org.apache.jasper.compiler.TldLocationsCache.level = FINE org.apache.jasper.servlet.TldScanner.level =精细

# 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路径.怎么了?

But I still get the warning at startup and not the unneeded JAR's paths. What's wrong?

推荐答案

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

Try debugging for everything by:

  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

  • 重新启动Tomcat

  • Restart Tomcat

    从Terminal运行以下命令以获取需要跳过的jar列表(由@ ajoseph-lust提供,位于帖子):

    Run the following from Terminal to get a list of jars that need to be skipped (courtesy of @joseph-lust on this post):

    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
    

  • 在用户主目录中打开skips.txt

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

    Add this list to {CATALINA-HOME}/conf/catalina.properties after the following line:

    org.apache.catalina.startup.TldConfig.jarsToSkip=
    

  • 完成操作后,请确保删除/注释此内容,以防止日志文件变得太大
  • 我仍然不确定为什么会发生这种情况,因为对于大多数人来说,取消TldLocationsCache行的注释似乎很有用.

    I am still not sure why this happens, as it seems to work for most to uncomment the TldLocationsCache line.

    这篇关于Tomcat 8启用调试日志记录以列出不需要的jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆