You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Andy Pahne <ap...@net22.de> on 2008/08/11 13:09:07 UTC

[T5] setup logging

I tried to setup Tapestry5 logging to level "info", but all "debug" 
messages are still logged. I think I did what the documentation told me 
to do
    http://tapestry.apache.org/tapestry5/guide/logging.html

Can anybody tell me what I am missing?


from my log4j.xml:

     <logger name="org.apache.tapestry5" additivity="false">
         <level value="info"/>
         <appender-ref ref="LoggingAppender"/>
     </logger>


from my log:

2008-08-11 13:08:17,437 DEBUG (ComponentClassTransformerImpl.java:177) - 
Finished class transformation: InternalClassTransformation[
public de.net22.oos.b2b.web.pages.secured.packages.NewPackage extends 
de.net22.oos.b2b.web.base.BaseB2BPage

extend method: public boolean 
dispatchComponentEvent(org.apache.tapestry5.runtime.ComponentEvent $1)
{
   if ($1.isAborted()) return $_;
   try
   {
     if ($1.matches("Success", "", 0))
     {
       $_ = true;
 
$1.setMethodDescription("de.net22.oos.b2b.web.pages.secured.packages.NewPackage.onSuccess() 
(at NewPackage.java:48)");
       if ($1.storeResult(($w) onSuccess())) return true;
     }
   }
   catch (RuntimeException ex) { throw ex; }
   catch (Exception ex) { throw new RuntimeException(ex); }
}
....


My log4j configuration is read, as all other settings in there are applied.

Andy

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


Re: [T5] setup logging

Posted by Sven Homburg <ho...@googlemail.com>.
    <appender name="console" class="org.apache.log4j.ConsoleAppender">
        <param name="Target" value="System.out"/>
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d %-5p %c{2} - %m%n"/>
        </layout>
    </appender>

    <category name="de.net22.oos.b2b.web.pages.secured.packages.NewPackage
">
        <priority value="info"/>
    </category>

    <root>
        <level value="warn"/>
        <appender-ref ref="console"/>
    </root>


2008/8/11 Andy Pahne <ap...@net22.de>

>
> I tried to setup Tapestry5 logging to level "info", but all "debug"
> messages are still logged. I think I did what the documentation told me to
> do
>   http://tapestry.apache.org/tapestry5/guide/logging.html
>
> Can anybody tell me what I am missing?
>
>
> from my log4j.xml:
>
>    <logger name="org.apache.tapestry5" additivity="false">
>        <level value="info"/>
>        <appender-ref ref="LoggingAppender"/>
>    </logger>
>
>
> from my log:
>
> 2008-08-11 13:08:17,437 DEBUG (ComponentClassTransformerImpl.java:177) -
> Finished class transformation: InternalClassTransformation[
> public de.net22.oos.b2b.web.pages.secured.packages.NewPackage extends
> de.net22.oos.b2b.web.base.BaseB2BPage
>
> extend method: public boolean
> dispatchComponentEvent(org.apache.tapestry5.runtime.ComponentEvent $1)
> {
>  if ($1.isAborted()) return $_;
>  try
>  {
>    if ($1.matches("Success", "", 0))
>    {
>      $_ = true;
>
> $1.setMethodDescription("de.net22.oos.b2b.web.pages.secured.packages.NewPackage.onSuccess()
> (at NewPackage.java:48)");
>      if ($1.storeResult(($w) onSuccess())) return true;
>    }
>  }
>  catch (RuntimeException ex) { throw ex; }
>  catch (Exception ex) { throw new RuntimeException(ex); }
> }
> ....
>
>
> My log4j configuration is read, as all other settings in there are applied.
>
> Andy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
with regards
Sven Homburg
http://www.chenillekit.org
http://tapestry5-components.googlecode.com

Re: [T5] setup logging

Posted by Andy Pahne <ap...@net22.de>.
Lutz Hühnken schrieb:
> Hm... I had the same problem once, and I figured it was because
> Tapestry doesn't use the log level configured for the
> "org.apache.tapestry5" category, but the level you define for your
> components.
> 
 > ...
 > That is something I find quite annoying and don't see much use in, by
 > the way.
 >


Yes, that's a bit weird. And for the application developer it's mostly 
not that much important to know how Tapestry transforms classes. But the 
debug messages in the developers's application package are important.


> Anyway, for me it worked using a log4j filter, as described in an
> earlier conversation on this list, see
> 
> http://www.nabble.com/T5%3A-How-to-configure-T5-not-to-display-unwanted-log-td16024408.html
> 

It works. Thanks.



> I don't think it makes a difference if you use logger or category in
> your log4j.xml. Actually, I think category has been renamed to logger
> at some point, so you might actually want to stick with logger.
> 

You are right, I tried it.

> Hth,
> 
> Lutz

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


Re: [T5] setup logging

Posted by Lutz Hühnken <lh...@googlemail.com>.
Hm... I had the same problem once, and I figured it was because
Tapestry doesn't use the log level configured for the
"org.apache.tapestry5" category, but the level you define for your
components.

As it is said on http://tapestry.apache.org/tapestry5/guide/logging.html :
When a component's logger is configured at the DEBUG level, you will
also see added output when the class is first accessed identifying how
Tapestry is modifying the bytecode of the class.

That is something I find quite annoying and don't see much use in, by the way.

Anyway, for me it worked using a log4j filter, as described in an
earlier conversation on this list, see

http://www.nabble.com/T5%3A-How-to-configure-T5-not-to-display-unwanted-log-td16024408.html

I don't think it makes a difference if you use logger or category in
your log4j.xml. Actually, I think category has been renamed to logger
at some point, so you might actually want to stick with logger.

Hth,

Lutz



On Tue, Aug 12, 2008 at 12:24 AM, Filip S. Adamsen <fs...@fsadev.com> wrote:
> Ah, okay.
>
> No, you don't have to configure SLF4J - it's using log4j by default.
>
> Looks like Sven might have given the answer you need. Does it work if you
> use <category/> instead of <logger/>?
>
> -Filip
>
> Andy Pahne skrev:
>>
>> No, that's not the case if you use log4j XML configuration file format.
>>
>> Still no idea...
>>
>> Do I have to configure SLF4J or is it sufficient to configure log4j?
>>
>> Andy
>>
>>
>>
>> Filip S. Adamsen schrieb:
>>>
>>> Hi,
>>>
>>> You need to prefix the logger name with log4j.category. or it won't work.
>>>
>>> Or, at least that's how it was back when I used log4j - I'm now using
>>> SLF4J with Logback and I'm not going back. :)
>>>
>>> -Filip
>
> ---------------------------------------------------------------------
> 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] setup logging

Posted by "Filip S. Adamsen" <fs...@fsadev.com>.
Ah, okay.

No, you don't have to configure SLF4J - it's using log4j by default.

Looks like Sven might have given the answer you need. Does it work if 
you use <category/> instead of <logger/>?

-Filip

Andy Pahne skrev:
> 
> No, that's not the case if you use log4j XML configuration file format.
> 
> Still no idea...
> 
> Do I have to configure SLF4J or is it sufficient to configure log4j?
> 
> Andy
> 
> 
> 
> Filip S. Adamsen schrieb:
>> Hi,
>>
>> You need to prefix the logger name with log4j.category. or it won't work.
>>
>> Or, at least that's how it was back when I used log4j - I'm now using 
>> SLF4J with Logback and I'm not going back. :)
>>
>> -Filip

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


Re: [T5] setup logging

Posted by Andy Pahne <ap...@net22.de>.
No, that's not the case if you use log4j XML configuration file format.

Still no idea...

Do I have to configure SLF4J or is it sufficient to configure log4j?

Andy



Filip S. Adamsen schrieb:
> Hi,
> 
> You need to prefix the logger name with log4j.category. or it won't work.
> 
> Or, at least that's how it was back when I used log4j - I'm now using 
> SLF4J with Logback and I'm not going back. :)
> 
> -Filip

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


Re: [T5] setup logging

Posted by "Filip S. Adamsen" <fs...@fsadev.com>.
Hi,

You need to prefix the logger name with log4j.category. or it won't work.

Or, at least that's how it was back when I used log4j - I'm now using 
SLF4J with Logback and I'm not going back. :)

-Filip

Andy Pahne skrev:
> 
> I tried to setup Tapestry5 logging to level "info", but all "debug" 
> messages are still logged. I think I did what the documentation told me 
> to do
>    http://tapestry.apache.org/tapestry5/guide/logging.html
> 
> Can anybody tell me what I am missing?
> 
> 
> from my log4j.xml:
> 
>     <logger name="org.apache.tapestry5" additivity="false">
>         <level value="info"/>
>         <appender-ref ref="LoggingAppender"/>
>     </logger>
> 
> 
> from my log:
> 
> 2008-08-11 13:08:17,437 DEBUG (ComponentClassTransformerImpl.java:177) - 
> Finished class transformation: InternalClassTransformation[
> public de.net22.oos.b2b.web.pages.secured.packages.NewPackage extends 
> de.net22.oos.b2b.web.base.BaseB2BPage
> 
> extend method: public boolean 
> dispatchComponentEvent(org.apache.tapestry5.runtime.ComponentEvent $1)
> {
>   if ($1.isAborted()) return $_;
>   try
>   {
>     if ($1.matches("Success", "", 0))
>     {
>       $_ = true;
> 
> $1.setMethodDescription("de.net22.oos.b2b.web.pages.secured.packages.NewPackage.onSuccess() 
> (at NewPackage.java:48)");
>       if ($1.storeResult(($w) onSuccess())) return true;
>     }
>   }
>   catch (RuntimeException ex) { throw ex; }
>   catch (Exception ex) { throw new RuntimeException(ex); }
> }
> ....
> 
> 
> My log4j configuration is read, as all other settings in there are applied.
> 
> Andy
> 
> ---------------------------------------------------------------------
> 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