On 12/06/2014 14:24, r...@apache.org wrote:
> Author: remm
> Date: Thu Jun 12 13:24:22 2014
> New Revision: 1602159
> 
> URL: http://svn.apache.org/r1602159
> Log:
> https://issues.apache.org/bugzilla/show_bug.cgi?id=56546 (very partial)
> Reduce verbosity of clear references logging. Although it is a good tool for 
> detecting leaks, the severity does not match the likely impact. Also avoid 
> having more than one logging for one event even if filtering becomes less 
> flexible.

-1.

These log messages indicate problems that users need to do something to
fix. While I've no problem with reducing error -> warning, logging them
at info is not acceptable.

I also think we can find a better solution for the places where two log
message were being generated.

I agree that there are use cases where these warnings can be ignored
(e.g. when Tomcat is being shut down) but the way to address that is to
skip logging of these issues during shutdown, not to reduce the log
level of the messages.

See https://issues.apache.org/bugzilla/show_bug.cgi?id=50175 for a
discussion around this. I still haven't got around to trying out the
ideas I mentioned in comment #6.

Mark


> 
> Modified:
>     tomcat/trunk/java/org/apache/catalina/loader/LocalStrings.properties
>     tomcat/trunk/java/org/apache/catalina/loader/LocalStrings_es.properties
>     tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java
> 
> Modified: tomcat/trunk/java/org/apache/catalina/loader/LocalStrings.properties
> URL: 
> http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/loader/LocalStrings.properties?rev=1602159&r1=1602158&r2=1602159&view=diff
> ==============================================================================
> --- tomcat/trunk/java/org/apache/catalina/loader/LocalStrings.properties 
> (original)
> +++ tomcat/trunk/java/org/apache/catalina/loader/LocalStrings.properties Thu 
> Jun 12 13:24:22 2014
> @@ -38,14 +38,12 @@ webappClassLoader.jarsModified=One or mo
>  webappClassLoader.jarsRemoved=One or more JARs have been removed from the 
> web application [{0}]
>  webappClassLoader.javaseClassLoaderNull=The j2seClassLoader attribute may 
> not be null
>  webappClassLoader.resourceModified=Resource [{0}] has been modified. The 
> last modified time was [{1}] and is now [{2}]
> -webappClassLoader.stackTrace=Stack trace of thread "{0}":{1}
> -webappClassLoader.stackTraceRequestThread=Stack trace of request processing 
> thread "{0}":{1}
> +webappClassLoader.stackTrace=The web application [{0}] appears to have 
> started a thread named [{1}] but has failed to stop it. This is very likely 
> to create a memory leak. Stack trace of thread:{2}
> +webappClassLoader.stackTraceRequestThread=The web application [{0}] is still 
> processing a request that has yet to finish. This is very likely to create a 
> memory leak. You can control the time allowed for requests to finish by using 
> the unloadDelay attribute of the standard Context implementation. Stack trace 
> of request processing thread:{2}
>  webappClassLoader.stopThreadFail=Failed to terminate thread named [{0}] for 
> web application [{1}]
>  webappClassLoader.stopTimerThreadFail=Failed to terminate TimerThread named 
> [{0}] for web application [{1}]
>  webappClassLoader.superCloseFail=Failure calling close() on super class
>  webappClassLoader.validationErrorJarPath=Unable to validate JAR entry with 
> name {0}
> -webappClassLoader.warnRequestThread=The web application [{0}] is still 
> processing a request that has yet to finish. This is very likely to create a 
> memory leak. You can control the time allowed for requests to finish by using 
> the unloadDelay attribute of the standard Context implementation.
> -webappClassLoader.warnThread=The web application [{0}] appears to have 
> started a thread named [{1}] but has failed to stop it. This is very likely 
> to create a memory leak.
>  webappClassLoader.warnTimerThread=The web application [{0}] appears to have 
> started a TimerThread named [{1}] via the java.util.Timer API but has failed 
> to stop it. To prevent a memory leak, the timer (and hence the associated 
> thread) has been forcibly canceled.
>  webappClassLoader.wrongVersion=(unable to load class {0})
>  webappClassLoader.addTransformer.illegalArgument=The web application [{0}] 
> attempted to add a null class file transformer.
> 
> Modified: 
> tomcat/trunk/java/org/apache/catalina/loader/LocalStrings_es.properties
> URL: 
> http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/loader/LocalStrings_es.properties?rev=1602159&r1=1602158&r2=1602159&view=diff
> ==============================================================================
> --- tomcat/trunk/java/org/apache/catalina/loader/LocalStrings_es.properties 
> (original)
> +++ tomcat/trunk/java/org/apache/catalina/loader/LocalStrings_es.properties 
> Thu Jun 12 13:24:22 2014
> @@ -31,8 +31,6 @@ webappClassLoader.checkThreadsHttpClient
>  webappClassLoader.stopThreadFail = No pude terminar el hilo con nombre [{0}] 
> para la aplicaci\u00F3n web [{1}]
>  webappClassLoader.stopTimerThreadFail = No pude terminar TimerThread con 
> nombre [{0}] para la aplicaci\u00F3n web [{1}]
>  webappClassLoader.validationErrorJarPath = no pude validar entrada JAR con 
> nombre {0}
> -webappClassLoader.warnRequestThread = La aplicaci\u00F3n web [{0}] a\u00FAn 
> se encuentra procesando un requerimiento que no ha terminados. Esto tiene 
> todas las papeletas de convertirse en un fallo de memoria. Puedes controlar 
> el tiempo permitido a los requerimientos para acabar mediante el uso del 
> atributo unloadDelay de la implementaci\u00F3n est\u00E1ndar de Contexto.
> -webappClassLoader.warnThread = La aplicaci\u00F3n web [{0}] parece haber 
> arrancado un hilo llamado [{1}] pero no ha podido pararlo. Esto tiene todas 
> las papeletas de convertirse en un fallo de memoria.
>  webappClassLoader.warnTimerThread = La aplicaci\u00F3n web [{0}] parece 
> haber arrancado un TimerThread con nombre [{1}] v\u00EDa de la API 
> java.util.Timer, pero no ha podido pararlo. Para prevenir un fallo de 
> memoria, el cron\u00F3metro (y el hilo asociado) hasido cancelado a la fuerza.
>  webappClassLoader.wrongVersion = (no puedo cargar clase {0})
>  webappLoader.addRepository = A\u00F1adiendo repositorio {0}
> 
> Modified: tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java
> URL: 
> http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java?rev=1602159&r1=1602158&r2=1602159&view=diff
> ==============================================================================
> --- tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java 
> (original)
> +++ tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java Thu 
> Jun 12 13:24:22 2014
> @@ -1633,14 +1633,14 @@ public class WebappClassLoader extends U
>              List<String> driverNames = (List<String>) 
> obj.getClass().getMethod(
>                      "clearJdbcDriverRegistrations").invoke(obj);
>              for (String name : driverNames) {
> -                log.error(sm.getString("webappClassLoader.clearJdbc",
> +                log.info(sm.getString("webappClassLoader.clearJdbc",
>                          getContextName(), name));
>              }
>          } catch (Exception e) {
>              // So many things to go wrong above...
>              Throwable t = ExceptionUtils.unwrapInvocationTargetException(e);
>              ExceptionUtils.handleThrowable(t);
> -            log.warn(sm.getString(
> +            log.info(sm.getString(
>                      "webappClassLoader.jdbcRemoveFailed", getContextName()), 
> t);
>          }
>      }
> @@ -1820,15 +1820,11 @@ public class WebappClassLoader extends U
>                      }
>  
>                      if (isRequestThread(thread)) {
> -                        
> log.error(sm.getString("webappClassLoader.warnRequestThread",
> -                                getContextName(), threadName));
>                          
> log.info(sm.getString("webappClassLoader.stackTraceRequestThread",
> -                                threadName, getStackTrace(thread)));
> +                                getContextName(), threadName, 
> getStackTrace(thread)));
>                      } else {
> -                        
> log.error(sm.getString("webappClassLoader.warnThread",
> -                                getContextName(), threadName));
>                          log.info(sm.getString("webappClassLoader.stackTrace",
> -                                threadName, getStackTrace(thread)));
> +                                getContextName(), threadName, 
> getStackTrace(thread)));
>                      }
>  
>                      // Don't try an stop the threads unless explicitly
> @@ -2003,14 +1999,14 @@ public class WebappClassLoader extends U
>                  }
>              }
>  
> -            log.error(sm.getString("webappClassLoader.warnTimerThread",
> +            log.info(sm.getString("webappClassLoader.warnTimerThread",
>                      getContextName(), thread.getName()));
>  
>          } catch (Exception e) {
>              // So many things to go wrong above...
>              Throwable t = ExceptionUtils.unwrapInvocationTargetException(e);
>              ExceptionUtils.handleThrowable(t);
> -            log.warn(sm.getString(
> +            log.info(sm.getString(
>                      "webappClassLoader.stopTimerThreadFail",
>                      thread.getName(), getContextName()), t);
>          }
> @@ -2057,7 +2053,7 @@ public class WebappClassLoader extends U
>              }
>          } catch (Throwable t) {
>              ExceptionUtils.handleThrowable(t);
> -            log.warn(sm.getString(
> +            log.info(sm.getString(
>                      "webappClassLoader.checkThreadLocalsForLeaksFail",
>                      getContextName()), t);
>          }
> @@ -2100,7 +2096,7 @@ public class WebappClassLoader extends U
>                                  try {
>                                      args[2] = key.toString();
>                                  } catch (Exception e) {
> -                                    log.error(sm.getString(
> +                                    log.info(sm.getString(
>                                              
> "webappClassLoader.checkThreadLocalsForLeaks.badKey",
>                                              args[1]), e);
>                                      args[2] = sm.getString(
> @@ -2112,7 +2108,7 @@ public class WebappClassLoader extends U
>                                  try {
>                                      args[4] = value.toString();
>                                  } catch (Exception e) {
> -                                    log.error(sm.getString(
> +                                    log.info(sm.getString(
>                                              
> "webappClassLoader.checkThreadLocalsForLeaks.badValue",
>                                              args[3]), e);
>                                      args[4] = sm.getString(
> @@ -2126,7 +2122,7 @@ public class WebappClassLoader extends U
>                                              args));
>                                  }
>                              } else {
> -                                log.error(sm.getString(
> +                                log.info(sm.getString(
>                                          
> "webappClassLoader.checkThreadLocalsForLeaks",
>                                          args));
>                              }
> @@ -2290,16 +2286,16 @@ public class WebappClassLoader extends U
>              log.info(sm.getString("webappClassLoader.clearRmiInfo",
>                      getContextName()), e);
>          } catch (SecurityException e) {
> -            log.warn(sm.getString("webappClassLoader.clearRmiFail",
> +            log.info(sm.getString("webappClassLoader.clearRmiFail",
>                      getContextName()), e);
>          } catch (NoSuchFieldException e) {
> -            log.warn(sm.getString("webappClassLoader.clearRmiFail",
> +            log.info(sm.getString("webappClassLoader.clearRmiFail",
>                      getContextName()), e);
>          } catch (IllegalArgumentException e) {
> -            log.warn(sm.getString("webappClassLoader.clearRmiFail",
> +            log.info(sm.getString("webappClassLoader.clearRmiFail",
>                      getContextName()), e);
>          } catch (IllegalAccessException e) {
> -            log.warn(sm.getString("webappClassLoader.clearRmiFail",
> +            log.info(sm.getString("webappClassLoader.clearRmiFail",
>                      getContextName()), e);
>          }
>      }
> @@ -2368,12 +2364,12 @@ public class WebappClassLoader extends U
>                          Integer.valueOf(countRemoved), getContextName()));
>              }
>          } catch (SecurityException e) {
> -            log.error(sm.getString(
> +            log.info(sm.getString(
>                      "webappClassLoader.clearReferencesResourceBundlesFail",
>                      getContextName()), e);
>          } catch (NoSuchFieldException e) {
>              if (Globals.IS_ORACLE_JVM) {
> -                log.error(sm.getString(
> +                log.info(sm.getString(
>                          
> "webappClassLoader.clearReferencesResourceBundlesFail",
>                          getContextName()), e);
>              } else {
> @@ -2382,11 +2378,11 @@ public class WebappClassLoader extends U
>                          getContextName()), e);
>              }
>          } catch (IllegalArgumentException e) {
> -            log.error(sm.getString(
> +            log.info(sm.getString(
>                      "webappClassLoader.clearReferencesResourceBundlesFail",
>                      getContextName()), e);
>          } catch (IllegalAccessException e) {
> -            log.error(sm.getString(
> +            log.info(sm.getString(
>                      "webappClassLoader.clearReferencesResourceBundlesFail",
>                      getContextName()), e);
>          }
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
> 


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

Reply via email to