Looks good. Apply as you like.

On Wed, Apr 6, 2011 at 3:29 PM, Gabriel Roldán <grol...@opengeo.org> wrote:

> Hey Justin, would you mind applying the bellow patch to
> RequestObjectLogger in order not to generate too many strings when not
> needed? I tested it by switching between geosever_developer and
> production logging while running a gwc seed task and it seems it does
> its job. The performance penalty for this case is around 3%. Not that a
> big deal, but still it'd be good to avoid unnecessary log calls?
>
> Cheers,
> Gabriel
>
> --- a/ows/src/main/java/org/geoserver/ows/util/RequestObjectLogger.java
> +++ b/ows/src/main/java/org/geoserver/ows/util/RequestObjectLogger.java
> @@ -4,6 +4,7 @@
>  */
>  package org.geoserver.ows.util;
>
> +import java.util.logging.Level;
>  import java.util.logging.Logger;
>
>  import org.aopalliance.intercept.MethodInterceptor;
> @@ -27,7 +28,9 @@ public class RequestObjectLogger implements
> MethodInterceptor {
>     }
>
>     public Object invoke(MethodInvocation invocation) throws Throwable
> {
> -
> +        if (!logger.isLoggable(Level.INFO)) {
> +            return invocation.proceed();
> +        }
>         StringBuffer log = new StringBuffer();
>         log.append("\n" + "Request: " +
> invocation.getMethod().getName());
>
>
> --
> Gabriel Roldan
> grol...@opengeo.org
> Expert service straight from the developers
>
>


-- 
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.
------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to