tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1133122 - in /tomcat/trunk: java/org/apache/jasper/compiler/TldLocationsCache.java java/org/apache/jasper/resources/LocalStrings.properties webapps/docs/changelog.xml
Date Tue, 07 Jun 2011 18:18:06 GMT
Author: markt
Date: Tue Jun  7 18:18:06 2011
New Revision: 1133122

URL: http://svn.apache.org/viewvc?rev=1133122&view=rev
Log:
Don't overwhelm logs with TLD scanning messages but make users aware there is room for improvement
and tell them how to get at the detail.

Modified:
    tomcat/trunk/java/org/apache/jasper/compiler/TldLocationsCache.java
    tomcat/trunk/java/org/apache/jasper/resources/LocalStrings.properties
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/jasper/compiler/TldLocationsCache.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/TldLocationsCache.java?rev=1133122&r1=1133121&r2=1133122&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/TldLocationsCache.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/TldLocationsCache.java Tue Jun  7 18:18:06
2011
@@ -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"));
+            }
         }
     }
 

Modified: tomcat/trunk/java/org/apache/jasper/resources/LocalStrings.properties
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/resources/LocalStrings.properties?rev=1133122&r1=1133121&r2=1133122&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/resources/LocalStrings.properties (original)
+++ tomcat/trunk/java/org/apache/jasper/resources/LocalStrings.properties Tue Jun  7 18:18:06
2011
@@ -491,3 +491,4 @@ jsp.message.jsp_unload_check=Checking JS
 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

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1133122&r1=1133121&r2=1133122&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Tue Jun  7 18:18:06 2011
@@ -60,6 +60,16 @@
       </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>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message