You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Will Norris <wi...@willnorris.com> on 2008/01/04 19:20:24 UTC

T5: Logging

I'm running into what must be a common "problem" (bug or feature, you  
decide) though I can't find much info about it in the list archives or  
online.  I'm becoming continually frustrated by the fact that the  
TRACE and DEBUG log levels are rendered basically useless for pages  
and components because of the amount of logging the framework itself  
adds.  I certainly understand the unique difficulty in getting around  
this given how Tapestry works... you can't simply adjust the level for  
different packages like you would in most cases.  Is there something  
I'm missing that others are doing to alleviate this?  Can I turn off  
logging from within T5 itself?  Is it possible to have T5 use a  
different naming convention for the logger name (maybe add "tapestry."  
to the beginning)?  How are others handling this?

Thanks,
Will

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5: Logging

Posted by Howard Lewis Ship <hl...@gmail.com>.
I think this is an excellent suggestion.

On Jan 4, 2008 12:48 PM, Will Norris <wi...@willnorris.com> wrote:
>
> On Jan 4, 2008, at 11:56 AM, Will Norris wrote:
>
> > Perhaps a specific string can be prepended to T5 framework log
> > messages, so that they can be filtered out in the logger
> > configuration?  Is that already possible by some global
> > configuration, or should I add an issue?
>
> Even better, I think I found the Right Way to do it... attach a
> org.slf4j.Marker to Tapestry framework log messages.  This allows
> framework messages to be flagged in a special way that doesn't alter
> the content of the actual message, but still allows them to be dealt
> with differently than user-generated log messages.  And now that I
> look at it, there are only three debug() calls and a single trace()
> call in tapestry-core, so this should be relatively simple.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5: Logging

Posted by Will Norris <wi...@willnorris.com>.
On Jan 4, 2008, at 11:56 AM, Will Norris wrote:

> Perhaps a specific string can be prepended to T5 framework log  
> messages, so that they can be filtered out in the logger  
> configuration?  Is that already possible by some global  
> configuration, or should I add an issue?

Even better, I think I found the Right Way to do it... attach a  
org.slf4j.Marker to Tapestry framework log messages.  This allows  
framework messages to be flagged in a special way that doesn't alter  
the content of the actual message, but still allows them to be dealt  
with differently than user-generated log messages.  And now that I  
look at it, there are only three debug() calls and a single trace()  
call in tapestry-core, so this should be relatively simple.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5: Logging

Posted by Will Norris <wi...@willnorris.com>.
Actually we're not talking about log4j category loggers... we're  
talking about slf4j loggers.  I point that out only because I'm using  
logback, not log4j.  Nevertheless, I think I've found a good enough  
solution for the time being... adding an appender filter.  The primary  
offender in the DEBUG level is the message that logs what class  
transformation has been performed.  It always begins with the string  
"Finished class transformation:".  Therefore I've added a filter that  
will deny all messages that begin with that string.  Here is my  
logback appender configuration, though I'm pretty sure log4j supports  
basically the same thing...

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
   <filter class="ch.qos.logback.core.filter.EvaluatorFilter">
     <evaluator name="REMOVE_TAPESTRY">
       <expression>message.startsWith("Finished class  
transformation:")</expression>
     </evaluator>
     <OnMismatch>NEUTRAL</OnMismatch>
     <OnMatch>DENY</OnMatch>
   </filter>
   <layout class="ch.qos.logback.classic.PatternLayout">
     <Pattern>%d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n</Pattern>
   </layout>
</appender>

This works for DEBUG since that single log message was causing me the  
most grief.  However, in TRACE it would likely be many more.  Perhaps  
a specific string can be prepended to T5 framework log messages, so  
that they can be filtered out in the logger configuration?  Is that  
already possible by some global configuration, or should I add an issue?

-will


On Jan 4, 2008, at 11:19 AM, Fernando Padilla wrote:

> I'm sorry, but no.  They do not come from different loggers.  What are
> you talking about?
>
> We are talking about log4j category loggers.  And tapestry is using  
> the
> classname of the page, and we're using the classname of the page  
> (which
> is the standard), and hence we can't change the loglevel of what
> tapestry outputs, without changing the log level of what our own code
> outputs...
>
> Have you seen this on your server?
> Have you dealt with this yourself?
>
> Hugo Palma wrote:
>> You can differentiate. They come from different loggers.
>> You can configure log4j(if that's what your using) to ignore(or  
>> send to
>> another appender) DEBUG and TRACE messages from Tapestry.
>>
>> Will Norris wrote:
>>> My concern isn't ERROR and FATAL messages being lost in the noise...
>>> that can easily be done with some logging configuration as you've
>>> suggested.  My concern is my own DEBUG and TRACE messages being lost
>>> in the noise, since there is no way to differentiate my own messages
>>> from those generated by Tapestry.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5: Logging

Posted by Fernando Padilla <fe...@alum.mit.edu>.
I'm sorry, but no.  They do not come from different loggers.  What are
you talking about?

We are talking about log4j category loggers.  And tapestry is using the
classname of the page, and we're using the classname of the page (which
is the standard), and hence we can't change the loglevel of what
tapestry outputs, without changing the log level of what our own code
outputs...

Have you seen this on your server?
Have you dealt with this yourself?




Hugo Palma wrote:
> You can differentiate. They come from different loggers.
> You can configure log4j(if that's what your using) to ignore(or send to
> another appender) DEBUG and TRACE messages from Tapestry.
> 
> Will Norris wrote:
>> My concern isn't ERROR and FATAL messages being lost in the noise...
>> that can easily be done with some logging configuration as you've
>> suggested.  My concern is my own DEBUG and TRACE messages being lost
>> in the noise, since there is no way to differentiate my own messages
>> from those generated by Tapestry.
>>
>> -will
>>
>> On Jan 4, 2008, at 10:33 AM, Kalle Korhonen wrote:
>>
>>> One of the easiest things you can do to combat this problem is to
>>> configure
>>> logging to output log messages from your application to a separate
>>> log file and
>>> yet another output for all of those critical ERROR and FATAL messages so
>>> they don't get lost in the noise that easily.
>>>
>>> Kalle
>>>
>>>
>>> On 1/4/08, Fernando Padilla <fe...@alum.mit.edu> wrote:
>>>>
>>>> +1
>>>>
>>>> We are in the same boat:
>>>>
>>>> I also dislike the fact that tapestry spits out the generated javacode
>>>> using the classname of the page, such that we can't filter it out..
>>>> it's
>>>> also hard for us to pay attention to any debug output during the first
>>>> few requests.
>>>>
>>>>
>>>> Will Norris wrote:
>>>>> I'm running into what must be a common "problem" (bug or feature, you
>>>>> decide) though I can't find much info about it in the list archives or
>>>>> online.  I'm becoming continually frustrated by the fact that the
>>>>> TRACE
>>>>> and DEBUG log levels are rendered basically useless for pages and
>>>>> components because of the amount of logging the framework itself adds.
>>>>> I certainly understand the unique difficulty in getting around this
>>>>> given how Tapestry works... you can't simply adjust the level for
>>>>> different packages like you would in most cases.  Is there
>>>>> something I'm
>>>>> missing that others are doing to alleviate this?  Can I turn off
>>>>> logging
>>>>> from within T5 itself?  Is it possible to have T5 use a different
>>>>> naming
>>>>> convention for the logger name (maybe add "tapestry." to the
>>>>> beginning)?  How are others handling this?
>>>>>
>>>>> Thanks,
>>>>> Will
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5: Logging

Posted by Hugo Palma <hu...@gmail.com>.
You can differentiate. They come from different loggers.
You can configure log4j(if that's what your using) to ignore(or send to 
another appender) DEBUG and TRACE messages from Tapestry.

Will Norris wrote:
> My concern isn't ERROR and FATAL messages being lost in the noise... 
> that can easily be done with some logging configuration as you've 
> suggested.  My concern is my own DEBUG and TRACE messages being lost 
> in the noise, since there is no way to differentiate my own messages 
> from those generated by Tapestry.
>
> -will
>
> On Jan 4, 2008, at 10:33 AM, Kalle Korhonen wrote:
>
>> One of the easiest things you can do to combat this problem is to 
>> configure
>> logging to output log messages from your application to a separate 
>> log file and
>> yet another output for all of those critical ERROR and FATAL messages so
>> they don't get lost in the noise that easily.
>>
>> Kalle
>>
>>
>> On 1/4/08, Fernando Padilla <fe...@alum.mit.edu> wrote:
>>>
>>> +1
>>>
>>> We are in the same boat:
>>>
>>> I also dislike the fact that tapestry spits out the generated javacode
>>> using the classname of the page, such that we can't filter it out.. 
>>> it's
>>> also hard for us to pay attention to any debug output during the first
>>> few requests.
>>>
>>>
>>> Will Norris wrote:
>>>> I'm running into what must be a common "problem" (bug or feature, you
>>>> decide) though I can't find much info about it in the list archives or
>>>> online.  I'm becoming continually frustrated by the fact that the 
>>>> TRACE
>>>> and DEBUG log levels are rendered basically useless for pages and
>>>> components because of the amount of logging the framework itself adds.
>>>> I certainly understand the unique difficulty in getting around this
>>>> given how Tapestry works... you can't simply adjust the level for
>>>> different packages like you would in most cases.  Is there 
>>>> something I'm
>>>> missing that others are doing to alleviate this?  Can I turn off 
>>>> logging
>>>> from within T5 itself?  Is it possible to have T5 use a different 
>>>> naming
>>>> convention for the logger name (maybe add "tapestry." to the
>>>> beginning)?  How are others handling this?
>>>>
>>>> Thanks,
>>>> Will
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5: Logging

Posted by Will Norris <wi...@willnorris.com>.
My concern isn't ERROR and FATAL messages being lost in the noise...  
that can easily be done with some logging configuration as you've  
suggested.  My concern is my own DEBUG and TRACE messages being lost  
in the noise, since there is no way to differentiate my own messages  
from those generated by Tapestry.

-will

On Jan 4, 2008, at 10:33 AM, Kalle Korhonen wrote:

> One of the easiest things you can do to combat this problem is to  
> configure
> logging to output log messages from your application to a separate  
> log file and
> yet another output for all of those critical ERROR and FATAL  
> messages so
> they don't get lost in the noise that easily.
>
> Kalle
>
>
> On 1/4/08, Fernando Padilla <fe...@alum.mit.edu> wrote:
>>
>> +1
>>
>> We are in the same boat:
>>
>> I also dislike the fact that tapestry spits out the generated  
>> javacode
>> using the classname of the page, such that we can't filter it out..  
>> it's
>> also hard for us to pay attention to any debug output during the  
>> first
>> few requests.
>>
>>
>> Will Norris wrote:
>>> I'm running into what must be a common "problem" (bug or feature,  
>>> you
>>> decide) though I can't find much info about it in the list  
>>> archives or
>>> online.  I'm becoming continually frustrated by the fact that the  
>>> TRACE
>>> and DEBUG log levels are rendered basically useless for pages and
>>> components because of the amount of logging the framework itself  
>>> adds.
>>> I certainly understand the unique difficulty in getting around this
>>> given how Tapestry works... you can't simply adjust the level for
>>> different packages like you would in most cases.  Is there  
>>> something I'm
>>> missing that others are doing to alleviate this?  Can I turn off  
>>> logging
>>> from within T5 itself?  Is it possible to have T5 use a different  
>>> naming
>>> convention for the logger name (maybe add "tapestry." to the
>>> beginning)?  How are others handling this?
>>>
>>> Thanks,
>>> Will
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5: Logging

Posted by Kalle Korhonen <ka...@gmail.com>.
One of the easiest things you can do to combat this problem is to configure
logging to output log messages from your application to a separate log file and
yet another output for all of those critical ERROR and FATAL messages so
they don't get lost in the noise that easily.

Kalle


On 1/4/08, Fernando Padilla <fe...@alum.mit.edu> wrote:
>
> +1
>
> We are in the same boat:
>
> I also dislike the fact that tapestry spits out the generated javacode
> using the classname of the page, such that we can't filter it out.. it's
> also hard for us to pay attention to any debug output during the first
> few requests.
>
>
> Will Norris wrote:
> > I'm running into what must be a common "problem" (bug or feature, you
> > decide) though I can't find much info about it in the list archives or
> > online.  I'm becoming continually frustrated by the fact that the TRACE
> > and DEBUG log levels are rendered basically useless for pages and
> > components because of the amount of logging the framework itself adds.
> > I certainly understand the unique difficulty in getting around this
> > given how Tapestry works... you can't simply adjust the level for
> > different packages like you would in most cases.  Is there something I'm
> > missing that others are doing to alleviate this?  Can I turn off logging
> > from within T5 itself?  Is it possible to have T5 use a different naming
> > convention for the logger name (maybe add "tapestry." to the
> > beginning)?  How are others handling this?
> >
> > Thanks,
> > Will
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: T5: Logging

Posted by Fernando Padilla <fe...@alum.mit.edu>.
+1

We are in the same boat:

I also dislike the fact that tapestry spits out the generated javacode
using the classname of the page, such that we can't filter it out.. it's
also hard for us to pay attention to any debug output during the first
few requests.


Will Norris wrote:
> I'm running into what must be a common "problem" (bug or feature, you
> decide) though I can't find much info about it in the list archives or
> online.  I'm becoming continually frustrated by the fact that the TRACE
> and DEBUG log levels are rendered basically useless for pages and
> components because of the amount of logging the framework itself adds. 
> I certainly understand the unique difficulty in getting around this
> given how Tapestry works... you can't simply adjust the level for
> different packages like you would in most cases.  Is there something I'm
> missing that others are doing to alleviate this?  Can I turn off logging
> from within T5 itself?  Is it possible to have T5 use a different naming
> convention for the logger name (maybe add "tapestry." to the
> beginning)?  How are others handling this?
> 
> Thanks,
> Will
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org