One way to do this is with the log4j filter. You can write your own
filter to do anything you want, but mine simply silently drops
Tapestry logs.

public class Log4jFilter extends Filter {

        private String[] _prefix;
        
        private boolean _convertToLowerCase = false;
        
        @Override
        public int decide(LoggingEvent aEvent) {

                try {
                        LocationInfo info = aEvent.getLocationInformation();
                        String className = (_convertToLowerCase ?
                                        info.getClassName().toLowerCase() : 
info.getClassName());
                        
                        for(String prefix : _prefix) {
                                if(className.startsWith(prefix))
                                        return Filter.DENY;
                        }
                }
                catch(NullPointerException npe) {
                        return Filter.NEUTRAL;
                }
                
                return Filter.NEUTRAL;
        }

        public void setPrefix(String aPrefix) {
                if(aPrefix != null) {
                        _prefix = aPrefix.split("\\|");
                }
        }

        public void setConvertToLowerCase(boolean aConvertToLowerCase) {
                _convertToLowerCase = aConvertToLowerCase;
        }       
}

Then, in your log4j configuration do something like:

<appender ....>
    <filter class="com.foo.bar.Log4jFilter">
        <param name="prefix"
value="org.apache.tapestry|org.anything.you.want|org.and.more"/>
    </filter>
</appender>

-adam

On Thu, Mar 13, 2008 at 4:39 AM, Joshua Jackson <[EMAIL PROTECTED]> wrote:
> Dear all,
>
>  Currently I am using T 5.0.11 and it displays a helluva message in the
>  logs. Is there any way to configure not to display those messages? I
>  already configured in log4j.properties the log level for
>  org.apache.tapestry to ERROR, but it is no good. Can anyone give me a
>  hint on this?
>
>  Thanks in advance
>
>  --
>  Let's show the world what we've got.
>
>  Blog: http://joshuajava.wordpress.com/
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>  For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to