Don't overwhelm logs with TLD scanning messages but make users aware there is room...
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 7 Jun 2011 18:18:06 +0000 (18:18 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 7 Jun 2011 18:18:06 +0000 (18:18 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1133122 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/jasper/compiler/TldLocationsCache.java
java/org/apache/jasper/resources/LocalStrings.properties
webapps/docs/changelog.xml

index 1258c48..3c85395 100644 (file)
@@ -96,6 +96,10 @@ public class TldLocationsCache {
     // Names of JARs that are known not to contain any TLDs
     private static Set<String> noTldJars = null;
 
+    // Flag that indicates that an INFO level message has been provided that
+    // there are JARs that could be skipped
+    private static volatile boolean showTldScanWarning = true;
+
     /**
      * The mapping of the 'global' tag library URI to the location (resource
      * path) of the TLD associated with that tag library. The location is
@@ -438,8 +442,15 @@ public class TldLocationsCache {
         }
 
         if (!foundTld) {
-            log.info(Localizer.getMessage("jsp.tldCache.noTldInJar",
-                    resourcePath));
+            if (log.isDebugEnabled()) {
+                log.debug(Localizer.getMessage("jsp.tldCache.noTldInJar",
+                        resourcePath));
+            } else if (showTldScanWarning) {
+                // Not entirely thread-safe but a few duplicate log messages are
+                // not a huge issue
+                showTldScanWarning = true;
+                log.info(Localizer.getMessage("jsp.tldCache.noTldSummary"));
+            }
         }
     }
 
index 74569c6..3939af6 100644 (file)
@@ -491,3 +491,4 @@ jsp.message.jsp_unload_check=Checking JSPs for unload in context [{0}], JSP coun
 xmlParser.skipBomFail=Failed to skip BOM when parsing XML input stream
 
 jsp.tldCache.noTldInJar=No TLD files were found in [{0}]. Consider adding the JAR to to the tomcat.util.scan.DefaultJarScanner.jarsToSkip in CATALINA_BASE/catalina.properties
+jsp.tldCache.noTldSummary=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 where no TLDs were found. Skipping JAR scanning can improve startup time and JSP compilation time.
\ No newline at end of file
index 786fa8b..65ffe52 100644 (file)
       </fix>
     </changelog>
   </subsection>
+  <subsection name="Jasper">
+    <changelog>
+      <update>
+        Change JAR scanning log messages where no TLDs are found to DEBUG level
+        and replace the multiple messages with a single INFO level message that
+        indicates that at least one JAR was scanned needlessly and how to obtain
+        more info. (markt)
+      </update>
+    </changelog>
+  </subsection>
   <subsection name="Web applications">
     <changelog>
       <fix>