Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tomcat 8 enable debug logging to list unneeded jars

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

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.`

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?

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 = 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

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

like image 721
Pascal Schulz Avatar asked Jul 18 '14 09:07

Pascal Schulz


People also ask

What does enable debug logging do?

Debug logging is a troubleshooting process that gathers a large amount of information and system logs to help find problems. We recommend only enabling this for a short time, as the log files can become very large on the end device.

How do I enable logs in debug mode?

You can permanently turn on debug logging by navigating to the Windows icon > Control Panel > System > Advanced system settings > Environment Variables… > New…

What is extra debug logging?

Debug logs are logs with an extended logging level. They can be helpful to support engineers when the application logs are insufficient to investigate an issue. Debug logs can be enabled for both Backup Manager and Recovery Console.


2 Answers

Try debugging for everything by:

  1. Adding this to the end of your logging.properties file located in {CATALINA-HOME}/conf:

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

  3. 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
    
  4. Open skips.txt in your user home directory

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

    org.apache.catalina.startup.TldConfig.jarsToSkip=
    
  6. Make sure to remove/comment out this when you are done to prevent your log files from growing too large

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

like image 60
tekNorah Avatar answered Sep 23 '22 18:09

tekNorah


An easier way, in step 1 of the above post, instead of enabling debugging for everything, limit to org.apache.jasper:

Use this:

org.apache.jasper.level = FINEST

Instead of this:

org.apache.catalina.level=FINEST
like image 20
Crmwind Avatar answered Sep 23 '22 18:09

Crmwind