jakarta-jcs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Kristian <jkrist...@docent.com>
Subject RE: patch: log defaults at DEBUG level
Date Mon, 13 Oct 2003 17:05:38 GMT
> Perhaps info would be more appropriate than debug, however?

I defer to your better judgement.  To me, the fact that a default was not
overridden is so routine and boring that DEBUG is more appropriate that
INFO.  But I defer to your better judgement.  Patches for both alternatives
are attached.

> ... please adhere to pre-existing formatting conventions ...

OK.

> ... supply a change log message ...

Lower the log level of messages that report the use of default configuration
parameters.

> ... referencing the files which you changed ...

src/java/org/apache/jcs/config/OptionConverter.java
src/java/org/apache/jcs/engine/control/CompositeCacheConfigurator.java

- John Kristian


-----Original Message-----
From: Daniel L. Rall [mailto:dlr@finemaltcoding.com] 
Sent: Sunday, October 05, 2003 3:52 PM
To: Turbine JCS Developers List
Subject: Re: patch: log defaults at DEBUG level

I'm all for reducing the log level, and appreciate the check to save on 
unnecessary string creation.  Perhaps info would be more appropriate than 
debug, however?  Also, please adhere to pre-existing formatting conventions
of 
the files, and supply a change log message referencing the files which you 
changed.

- Dan

John Kristian wrote:
> I propose this patch:
> Index: src/java/org/apache/jcs/config/OptionConverter.java
> ===================================================================
> RCS file: 
> /home/cvspublic/jakarta-turbine-jcs/src/java/org/apache/jcs/config/Opt
> ionCon
> verter.java,v
> retrieving revision 1.2
> diff -u -r1.2 OptionConverter.java
> --- src/java/org/apache/jcs/config/OptionConverter.java 22 Aug 2003
11:57:19
> -0000 1.2
> +++ src/java/org/apache/jcs/config/OptionConverter.java 3 Oct 2003 
> +++ 19:07:54
> -0000
> @@ -186,7 +186,9 @@
>          String className = findAndSubst( key, props );
>          if ( className == null )
>          {
> -            log.warn( "Could not find value for key " + key );
> +            if (log.isDebugEnabled()) {
> +                log.debug( "Could not find value for key " + key + "; 
> + using
> default." );
> +            }
>              return defaultValue;
>          }
>          // Trim className to avoid trailing spaces that cause 
> problems.
> Index:
> src/java/org/apache/jcs/engine/control/CompositeCacheConfigurator.java
> ===================================================================
> RCS file:
>
/home/cvspublic/jakarta-turbine-jcs/src/java/org/apache/jcs/engine/control/C
> ompositeCacheConfigurator.java,v
> retrieving revision 1.8
> diff -u -r1.8 CompositeCacheConfigurator.java
> --- src/java/org/apache/jcs/engine/control/CompositeCacheConfigurator.java
> 22 Aug 2003 11:57:18 -0000 1.8
> +++ src/java/org/apache/jcs/engine/control/CompositeCacheConfigurator.
> +++ java 3
> Oct 2003 19:07:54 -0000
> @@ -336,9 +336,9 @@
>  
> null );
>          if ( ccAttr == null )
>          {
> -            log.warn( "Could not instantiate ccAttr named '" + attrName +
> -                      "', using defaults." );
> -
> +            if (log.isDebugEnabled()) {
> +                log.debug( "Could not instantiate ccAttr named '" +
> attrName + "'; using defaults." );
> +            }
>              ICompositeCacheAttributes ccAttr2 = 
> ccMgr.getDefaultCacheAttributes();
>              ccAttr = ccAttr2.copy();
>          }
> @@ -372,9 +372,9 @@
>  
> null );
>          if ( eAttr == null )
>          {
> -            log.warn( "Could not instantiate eAttr named '" + attrName +
> -                      "', using defaults." );
> -
> +            if (log.isDebugEnabled()) {
> +                log.debug( "Could not instantiate eAttr named '" + 
> + attrName "'; using defaults." );
> +            }
>              IElementAttributes eAttr2 = 
> ccMgr.getDefaultElementAttributes();
>              eAttr = eAttr2.copy();
>          }
> - John Kristian
>  
> P.S. Why?  For example, it prevents a Hibernate application from 
> logging the following crap at startup, which is distracting and 
> worries users needlessly:
> 2003-10-03 13:12:06,921 WARN
> [org.apache.jcs.engine.control.CompositeCacheConfigurator] Could not
> instantiate eAttr named 'jcs.system.groupIdCache.elementattributes', using
> defaults.
> 2003-10-03 13:12:06,968 WARN  [org.apache.jcs.config.OptionConverter]
Could
> not find value for key
>
jcs.region.com.docent.lms.entities.reference.ReferencePermission$Factory.COD
> E_TO_IDS.elementattributes
> 2003-10-03 13:12:06,968 WARN
> [org.apache.jcs.engine.control.CompositeCacheConfigurator] Could not
> instantiate eAttr named
>
'jcs.region.com.docent.lms.entities.reference.ReferencePermission$Factory.CO
> DE_TO_IDS.elementattributes', using defaults.
> 2003-10-03 13:12:07,171 WARN  [org.apache.jcs.config.OptionConverter]
Could
> not find value for key


Mime
View raw message