You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by cleverpig <gr...@gmail.com> on 2009/09/22 05:16:18 UTC

T5:how to inject slf4j service?

i always use log4j for a long time.and now i will change to new weapon--slf4j!

i use @inject annotation to request this slf4j logging service:
public class Start{
...
	@Inject
	private Logger log;
...
}
but got a expection:
No service implements the interface org.slf4j.Logger
...

i found some little words about
slf4j:http://tapestry.apache.org/tapestry5.1/guide/logging.html

"Logging of Tapestry Components and Pages
Tapestry makes extensive use of SLF4J to log details about the
creation and operation of your page and component classes.
The default configuration for logging uses Log4J as the logging
toolkit, though this can be changed."

but "this can be changed" page link is invalid.

somebody help me?give me example to fire a light in my darkness. :)

-- 
cleverpig(Dan)
Location: Beijing
Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
Zipcode: 100031
MSN: great_liudan@hotmail.com
QQ: 149291732
Skype: cleverpigatmatrix
Facebook ID:cleverpig
Blog: www.cleverpig.name
Tags: del.icio.us/cleverpig
Twitter: twitter.com/cleverpig
新浪微博: t.sina.com.cn/cleverpig
Organization: www.beijing-open-party.org
Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294

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


Re: T5:how to inject slf4j service?

Posted by cleverpig <gr...@gmail.com>.
i used maven to create the project. what's your mean about starting a
project? run app in jetty with maven?

2009/9/24 Otho <ta...@googlemail.com>:
> When you just use the maven archetype for starting a project everything
> works right out of the box.
>
> 2009/9/24 cleverpig <gr...@gmail.com>
>
>> it's exactly,you should have a Logger service when tapestry startup..
>>
>> but if i comment this function in AppModule,i would miss Logger service:
>> public Logger buildLogger(final Logger log){
>>    return log;
>> }
>>
>> After commented,it was only 3 service about logging in service list
>> when app startup:
>> ...
>> LoggerSource: BUILTIN
>> LoggingAdvisor: DEFINED
>> LoggingDecorator: DEFINED
>> ...
>> so strange..
>>
>> 2009/9/24 Alfonso Quiroga <al...@gmail.com>:
>> > Cleverpig:
>> > In my AppModule and ServerModule (I have 2 modules) I have nothing
>> > related to logging. I only have "bindings" between services interfaces
>> > and implementations, then I have request filters (hibernate filter),
>> > and finally I have advisors for services (this is like spring
>> > interceptors, but without XML's :)
>> >
>> > In my-package.base, I have "BasePage" where I have:
>> >
>> > (import org.slf4j.Logger)
>> >    @Inject private Logger logger;
>> >
>> > and that's all, I can use that logger (it has getter) in every page
>> > (all of my pages extends BasePage) and it works out of the box, I
>> > don't have to bind anything in modules. Hope it helps
>> >
>> > 2009/9/23 cleverpig <gr...@gmail.com>:
>> >> hi,Alfonso!
>> >>
>> >> please show me what's in your AppModule..let me get the reality...
>> >>
>> >> 2009/9/23 Alfonso Quiroga <al...@gmail.com>:
>> >>> Is your logging working now? I didn't do anything in AppModule, just
>> >>> drop the jars and logging works, if you still have problems, I can
>> >>> show you my project configuration, good luck
>> >>>
>> >>> 2009/9/23 cleverpig <gr...@gmail.com>:
>> >>>> so,after add the buildLogger function,we can use these code to inject
>> >>>> Logger service:
>> >>>>
>> >>>> Class Start{
>> >>>> ...
>> >>>> @Inject
>> >>>> private Logger log;
>> >>>> ...
>> >>>> }
>> >>>>
>> >>>> On Wed, Sep 23, 2009 at 12:29 PM, cleverpig <gr...@gmail.com>
>> wrote:
>> >>>>> I got the answer! It's so easy...thank all of my helpers and
>> opensource!
>> >>>>>
>> >>>>> my problem's solution:add this function in AppModule class:
>> >>>>>
>> >>>>> public Logger buildLogger(final Logger log){
>> >>>>>        return log;
>> >>>>> }
>> >>>>>
>> >>>>> I'd read this article:
>> http://java.dzone.com/news/tapestry-5-ioc-binding-and-bui,and
>> >>>>> learned what's the secret & key in there:
>> >>>>>
>> >>>>> ---Service Builder Methods---
>> >>>>>
>> >>>>> Sometimes just instantiating a class is not enough; there may be
>> >>>>> additional configuration needed as part of instantiating the class.
>> >>>>> Tapestry 5 IoC's predecessor, HiveMind, accomplished such goals with
>> >>>>> complex service-building services. It ended up being a lot of XML.
>> >>>>>
>> >>>>> T5 IoC accomplishes the same, and more, using service builder
>> methods;
>> >>>>> module methods that construct a service. A typical case is when a
>> >>>>> service implementation needs to listen to events from some other
>> >>>>> service:
>> >>>>>
>> >>>>> public static TranslatorSource
>> >>>>> buildTranslatorSource(ComponentInstantiatorSource
>> >>>>> componentInstantiatorSource,
>> >>>>> ServiceResources resources)
>> >>>>> {
>> >>>>>    TranslatorSourceImpl service =
>> >>>>> resources.autobuild(TranslatorSourceImpl.class);
>> >>>>>    componentInstantiatorSource.addInvalidationListener(service);
>> >>>>>    return service;
>> >>>>> }
>> >>>>>
>> >>>>> Module methods prefixed with "build" are service builder methods. The
>> >>>>> service interface is defined from the return value
>> (TranslatorSource).
>> >>>>> The service id is explicitly "TranslatorSource" (that is, everything
>> >>>>> after "build" in the method name).
>> >>>>>
>> >>>>> Here, Tapestry has injected into the service builder method.
>> >>>>> ComponentInstantiatorSource is a service that fires events.
>> >>>>> ServiceResources is something else: it is a bundle of resources
>> >>>>> related to the service being constructed ... including the ability to
>> >>>>> instantiate an object including dependencies. What's great here is
>> >>>>> that buildTranslatorSource() doesn't need to know what the
>> >>>>> dependencies of TranslatorSourceImpl are, it can instantiate the
>> class
>> >>>>> with dependencies using the autobuild() method. The service builder
>> >>>>> then adds the new service as a listener of the
>> >>>>> ComponentInstantiatorSource, before returning it.
>> >>>>>
>> >>>>>
>> >>>>> 2009/9/23 cleverpig <gr...@gmail.com>:
>> >>>>>> yes,i'd read it..but i can't get the door to answer...
>> >>>>>>
>> >>>>>> On Wed, Sep 23, 2009 at 9:57 AM, Thiago H. de Paula Figueiredo
>> >>>>>> <th...@gmail.com> wrote:
>> >>>>>>> Em Tue, 22 Sep 2009 21:55:44 -0300, cleverpig <
>> greatcleverpig@gmail.com>
>> >>>>>>> escreveu:
>> >>>>>>>
>> >>>>>>>> oh,thanks for your reply,Alfonso!
>> >>>>>>>> just now,i get know i need a slf4j implementation.i found a
>> >>>>>>>> implementation class from
>> slf4j.jar:org.slf4j.impl.Log4jLoggerAdapter.
>> >>>>>>>> but how to declare the binding of them? what's need to add in the
>> >>>>>>>> AppModule?
>> >>>>>>>
>> >>>>>>> Take a look at
>> >>>>>>> http://tapestry.apache.org/tapestry5.1/tapestry-ioc/service.html.
>> >>>>>>>
>> >>>>>>> --
>> >>>>>>> Thiago H. de Paula Figueiredo
>> >>>>>>> Independent Java consultant, developer, and instructor
>> >>>>>>> http://www.arsmachina.com.br/thiago
>> >>>>>>>
>> >>>>>>>
>> ---------------------------------------------------------------------
>> >>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> >>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>> >>>>>>>
>> >>>>>>>
>> >>>>>>
>> >>>>>>
>> >>>>>>
>> >>>>>> --
>> >>>>>> cleverpig(Dan)
>> >>>>>> Location: Beijing
>> >>>>>> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
>> >>>>>> Zipcode: 100031
>> >>>>>> MSN: great_liudan@hotmail.com
>> >>>>>> QQ: 149291732
>> >>>>>> Skype: cleverpigatmatrix
>> >>>>>> Facebook ID:cleverpig
>> >>>>>> Blog: www.cleverpig.name
>> >>>>>> Tags: del.icio.us/cleverpig
>> >>>>>> Twitter: twitter.com/cleverpig
>> >>>>>> 新浪微博: t.sina.com.cn/cleverpig
>> >>>>>> Organization: www.beijing-open-party.org
>> >>>>>> Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294
>> >>>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> --
>> >>>>> cleverpig(Dan)
>> >>>>> Location: Beijing
>> >>>>> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
>> >>>>> Zipcode: 100031
>> >>>>> MSN: great_liudan@hotmail.com
>> >>>>> QQ: 149291732
>> >>>>> Skype: cleverpigatmatrix
>> >>>>> Facebook ID:cleverpig
>> >>>>> Blog: www.cleverpig.name
>> >>>>> Tags: del.icio.us/cleverpig
>> >>>>> Twitter: twitter.com/cleverpig
>> >>>>> 新浪微博: t.sina.com.cn/cleverpig
>> >>>>> Organization: www.beijing-open-party.org
>> >>>>> Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294
>> >>>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>> --
>> >>>> cleverpig(Dan)
>> >>>> Location: Beijing
>> >>>> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
>> >>>> Zipcode: 100031
>> >>>> MSN: great_liudan@hotmail.com
>> >>>> QQ: 149291732
>> >>>> Skype: cleverpigatmatrix
>> >>>> Facebook ID:cleverpig
>> >>>> Blog: www.cleverpig.name
>> >>>> Tags: del.icio.us/cleverpig
>> >>>> Twitter: twitter.com/cleverpig
>> >>>> 新浪微博: t.sina.com.cn/cleverpig
>> >>>> Organization: www.beijing-open-party.org
>> >>>> Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294
>> >>>>
>> >>>> ---------------------------------------------------------------------
>> >>>> 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
>> >>>
>> >>>
>> >>
>> >>
>> >>
>> >> --
>> >> cleverpig(Dan)
>> >> Location: Beijing
>> >> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
>> >> Zipcode: 100031
>> >> MSN: great_liudan@hotmail.com
>> >> QQ: 149291732
>> >> Skype: cleverpigatmatrix
>> >> Facebook ID:cleverpig
>> >> Blog: www.cleverpig.name
>> >> Tags: del.icio.us/cleverpig
>> >> Twitter: twitter.com/cleverpig
>> >> 新浪微博: t.sina.com.cn/cleverpig
>> >> Organization: www.beijing-open-party.org
>> >> Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294
>> >>
>> >> ---------------------------------------------------------------------
>> >> 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
>> >
>> >
>>
>>
>>
>> --
>> cleverpig(Dan)
>> Location: Beijing
>> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
>> Zipcode: 100031
>> MSN: great_liudan@hotmail.com
>> QQ: 149291732
>> Skype: cleverpigatmatrix
>> Facebook ID:cleverpig
>> Blog: www.cleverpig.name
>> Tags: del.icio.us/cleverpig
>> Twitter: twitter.com/cleverpig
>> 新浪微博: t.sina.com.cn/cleverpig
>> Organization: www.beijing-open-party.org
>> Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>



-- 
cleverpig(Dan)
Location: Beijing
Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
Zipcode: 100031
MSN: great_liudan@hotmail.com
QQ: 149291732
Skype: cleverpigatmatrix
Facebook ID:cleverpig
Blog: www.cleverpig.name
Tags: del.icio.us/cleverpig
Twitter: twitter.com/cleverpig
新浪微博: t.sina.com.cn/cleverpig
Organization: www.beijing-open-party.org
Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294

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


Re: T5:how to inject slf4j service?

Posted by Otho <ta...@googlemail.com>.
When you just use the maven archetype for starting a project everything
works right out of the box.

2009/9/24 cleverpig <gr...@gmail.com>

> it's exactly,you should have a Logger service when tapestry startup..
>
> but if i comment this function in AppModule,i would miss Logger service:
> public Logger buildLogger(final Logger log){
>    return log;
> }
>
> After commented,it was only 3 service about logging in service list
> when app startup:
> ...
> LoggerSource: BUILTIN
> LoggingAdvisor: DEFINED
> LoggingDecorator: DEFINED
> ...
> so strange..
>
> 2009/9/24 Alfonso Quiroga <al...@gmail.com>:
> > Cleverpig:
> > In my AppModule and ServerModule (I have 2 modules) I have nothing
> > related to logging. I only have "bindings" between services interfaces
> > and implementations, then I have request filters (hibernate filter),
> > and finally I have advisors for services (this is like spring
> > interceptors, but without XML's :)
> >
> > In my-package.base, I have "BasePage" where I have:
> >
> > (import org.slf4j.Logger)
> >    @Inject private Logger logger;
> >
> > and that's all, I can use that logger (it has getter) in every page
> > (all of my pages extends BasePage) and it works out of the box, I
> > don't have to bind anything in modules. Hope it helps
> >
> > 2009/9/23 cleverpig <gr...@gmail.com>:
> >> hi,Alfonso!
> >>
> >> please show me what's in your AppModule..let me get the reality...
> >>
> >> 2009/9/23 Alfonso Quiroga <al...@gmail.com>:
> >>> Is your logging working now? I didn't do anything in AppModule, just
> >>> drop the jars and logging works, if you still have problems, I can
> >>> show you my project configuration, good luck
> >>>
> >>> 2009/9/23 cleverpig <gr...@gmail.com>:
> >>>> so,after add the buildLogger function,we can use these code to inject
> >>>> Logger service:
> >>>>
> >>>> Class Start{
> >>>> ...
> >>>> @Inject
> >>>> private Logger log;
> >>>> ...
> >>>> }
> >>>>
> >>>> On Wed, Sep 23, 2009 at 12:29 PM, cleverpig <gr...@gmail.com>
> wrote:
> >>>>> I got the answer! It's so easy...thank all of my helpers and
> opensource!
> >>>>>
> >>>>> my problem's solution:add this function in AppModule class:
> >>>>>
> >>>>> public Logger buildLogger(final Logger log){
> >>>>>        return log;
> >>>>> }
> >>>>>
> >>>>> I'd read this article:
> http://java.dzone.com/news/tapestry-5-ioc-binding-and-bui,and
> >>>>> learned what's the secret & key in there:
> >>>>>
> >>>>> ---Service Builder Methods---
> >>>>>
> >>>>> Sometimes just instantiating a class is not enough; there may be
> >>>>> additional configuration needed as part of instantiating the class.
> >>>>> Tapestry 5 IoC's predecessor, HiveMind, accomplished such goals with
> >>>>> complex service-building services. It ended up being a lot of XML.
> >>>>>
> >>>>> T5 IoC accomplishes the same, and more, using service builder
> methods;
> >>>>> module methods that construct a service. A typical case is when a
> >>>>> service implementation needs to listen to events from some other
> >>>>> service:
> >>>>>
> >>>>> public static TranslatorSource
> >>>>> buildTranslatorSource(ComponentInstantiatorSource
> >>>>> componentInstantiatorSource,
> >>>>> ServiceResources resources)
> >>>>> {
> >>>>>    TranslatorSourceImpl service =
> >>>>> resources.autobuild(TranslatorSourceImpl.class);
> >>>>>    componentInstantiatorSource.addInvalidationListener(service);
> >>>>>    return service;
> >>>>> }
> >>>>>
> >>>>> Module methods prefixed with "build" are service builder methods. The
> >>>>> service interface is defined from the return value
> (TranslatorSource).
> >>>>> The service id is explicitly "TranslatorSource" (that is, everything
> >>>>> after "build" in the method name).
> >>>>>
> >>>>> Here, Tapestry has injected into the service builder method.
> >>>>> ComponentInstantiatorSource is a service that fires events.
> >>>>> ServiceResources is something else: it is a bundle of resources
> >>>>> related to the service being constructed ... including the ability to
> >>>>> instantiate an object including dependencies. What's great here is
> >>>>> that buildTranslatorSource() doesn't need to know what the
> >>>>> dependencies of TranslatorSourceImpl are, it can instantiate the
> class
> >>>>> with dependencies using the autobuild() method. The service builder
> >>>>> then adds the new service as a listener of the
> >>>>> ComponentInstantiatorSource, before returning it.
> >>>>>
> >>>>>
> >>>>> 2009/9/23 cleverpig <gr...@gmail.com>:
> >>>>>> yes,i'd read it..but i can't get the door to answer...
> >>>>>>
> >>>>>> On Wed, Sep 23, 2009 at 9:57 AM, Thiago H. de Paula Figueiredo
> >>>>>> <th...@gmail.com> wrote:
> >>>>>>> Em Tue, 22 Sep 2009 21:55:44 -0300, cleverpig <
> greatcleverpig@gmail.com>
> >>>>>>> escreveu:
> >>>>>>>
> >>>>>>>> oh,thanks for your reply,Alfonso!
> >>>>>>>> just now,i get know i need a slf4j implementation.i found a
> >>>>>>>> implementation class from
> slf4j.jar:org.slf4j.impl.Log4jLoggerAdapter.
> >>>>>>>> but how to declare the binding of them? what's need to add in the
> >>>>>>>> AppModule?
> >>>>>>>
> >>>>>>> Take a look at
> >>>>>>> http://tapestry.apache.org/tapestry5.1/tapestry-ioc/service.html.
> >>>>>>>
> >>>>>>> --
> >>>>>>> Thiago H. de Paula Figueiredo
> >>>>>>> Independent Java consultant, developer, and instructor
> >>>>>>> http://www.arsmachina.com.br/thiago
> >>>>>>>
> >>>>>>>
> ---------------------------------------------------------------------
> >>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>>>>>
> >>>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> --
> >>>>>> cleverpig(Dan)
> >>>>>> Location: Beijing
> >>>>>> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
> >>>>>> Zipcode: 100031
> >>>>>> MSN: great_liudan@hotmail.com
> >>>>>> QQ: 149291732
> >>>>>> Skype: cleverpigatmatrix
> >>>>>> Facebook ID:cleverpig
> >>>>>> Blog: www.cleverpig.name
> >>>>>> Tags: del.icio.us/cleverpig
> >>>>>> Twitter: twitter.com/cleverpig
> >>>>>> 新浪微博: t.sina.com.cn/cleverpig
> >>>>>> Organization: www.beijing-open-party.org
> >>>>>> Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294
> >>>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>> --
> >>>>> cleverpig(Dan)
> >>>>> Location: Beijing
> >>>>> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
> >>>>> Zipcode: 100031
> >>>>> MSN: great_liudan@hotmail.com
> >>>>> QQ: 149291732
> >>>>> Skype: cleverpigatmatrix
> >>>>> Facebook ID:cleverpig
> >>>>> Blog: www.cleverpig.name
> >>>>> Tags: del.icio.us/cleverpig
> >>>>> Twitter: twitter.com/cleverpig
> >>>>> 新浪微博: t.sina.com.cn/cleverpig
> >>>>> Organization: www.beijing-open-party.org
> >>>>> Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294
> >>>>>
> >>>>
> >>>>
> >>>>
> >>>> --
> >>>> cleverpig(Dan)
> >>>> Location: Beijing
> >>>> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
> >>>> Zipcode: 100031
> >>>> MSN: great_liudan@hotmail.com
> >>>> QQ: 149291732
> >>>> Skype: cleverpigatmatrix
> >>>> Facebook ID:cleverpig
> >>>> Blog: www.cleverpig.name
> >>>> Tags: del.icio.us/cleverpig
> >>>> Twitter: twitter.com/cleverpig
> >>>> 新浪微博: t.sina.com.cn/cleverpig
> >>>> Organization: www.beijing-open-party.org
> >>>> Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> 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
> >>>
> >>>
> >>
> >>
> >>
> >> --
> >> cleverpig(Dan)
> >> Location: Beijing
> >> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
> >> Zipcode: 100031
> >> MSN: great_liudan@hotmail.com
> >> QQ: 149291732
> >> Skype: cleverpigatmatrix
> >> Facebook ID:cleverpig
> >> Blog: www.cleverpig.name
> >> Tags: del.icio.us/cleverpig
> >> Twitter: twitter.com/cleverpig
> >> 新浪微博: t.sina.com.cn/cleverpig
> >> Organization: www.beijing-open-party.org
> >> Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294
> >>
> >> ---------------------------------------------------------------------
> >> 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
> >
> >
>
>
>
> --
> cleverpig(Dan)
> Location: Beijing
> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
> Zipcode: 100031
> MSN: great_liudan@hotmail.com
> QQ: 149291732
> Skype: cleverpigatmatrix
> Facebook ID:cleverpig
> Blog: www.cleverpig.name
> Tags: del.icio.us/cleverpig
> Twitter: twitter.com/cleverpig
> 新浪微博: t.sina.com.cn/cleverpig
> Organization: www.beijing-open-party.org
> Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: T5:how to inject slf4j service?

Posted by cleverpig <gr...@gmail.com>.
it's exactly,you should have a Logger service when tapestry startup..

but if i comment this function in AppModule,i would miss Logger service:
public Logger buildLogger(final Logger log){
    return log;
}

After commented,it was only 3 service about logging in service list
when app startup:
...
LoggerSource: BUILTIN
LoggingAdvisor: DEFINED
LoggingDecorator: DEFINED
...
so strange..

2009/9/24 Alfonso Quiroga <al...@gmail.com>:
> Cleverpig:
> In my AppModule and ServerModule (I have 2 modules) I have nothing
> related to logging. I only have "bindings" between services interfaces
> and implementations, then I have request filters (hibernate filter),
> and finally I have advisors for services (this is like spring
> interceptors, but without XML's :)
>
> In my-package.base, I have "BasePage" where I have:
>
> (import org.slf4j.Logger)
>    @Inject private Logger logger;
>
> and that's all, I can use that logger (it has getter) in every page
> (all of my pages extends BasePage) and it works out of the box, I
> don't have to bind anything in modules. Hope it helps
>
> 2009/9/23 cleverpig <gr...@gmail.com>:
>> hi,Alfonso!
>>
>> please show me what's in your AppModule..let me get the reality...
>>
>> 2009/9/23 Alfonso Quiroga <al...@gmail.com>:
>>> Is your logging working now? I didn't do anything in AppModule, just
>>> drop the jars and logging works, if you still have problems, I can
>>> show you my project configuration, good luck
>>>
>>> 2009/9/23 cleverpig <gr...@gmail.com>:
>>>> so,after add the buildLogger function,we can use these code to inject
>>>> Logger service:
>>>>
>>>> Class Start{
>>>> ...
>>>> @Inject
>>>> private Logger log;
>>>> ...
>>>> }
>>>>
>>>> On Wed, Sep 23, 2009 at 12:29 PM, cleverpig <gr...@gmail.com> wrote:
>>>>> I got the answer! It's so easy...thank all of my helpers and opensource!
>>>>>
>>>>> my problem's solution:add this function in AppModule class:
>>>>>
>>>>> public Logger buildLogger(final Logger log){
>>>>>        return log;
>>>>> }
>>>>>
>>>>> I'd read this article:http://java.dzone.com/news/tapestry-5-ioc-binding-and-bui,and
>>>>> learned what's the secret & key in there:
>>>>>
>>>>> ---Service Builder Methods---
>>>>>
>>>>> Sometimes just instantiating a class is not enough; there may be
>>>>> additional configuration needed as part of instantiating the class.
>>>>> Tapestry 5 IoC's predecessor, HiveMind, accomplished such goals with
>>>>> complex service-building services. It ended up being a lot of XML.
>>>>>
>>>>> T5 IoC accomplishes the same, and more, using service builder methods;
>>>>> module methods that construct a service. A typical case is when a
>>>>> service implementation needs to listen to events from some other
>>>>> service:
>>>>>
>>>>> public static TranslatorSource
>>>>> buildTranslatorSource(ComponentInstantiatorSource
>>>>> componentInstantiatorSource,
>>>>> ServiceResources resources)
>>>>> {
>>>>>    TranslatorSourceImpl service =
>>>>> resources.autobuild(TranslatorSourceImpl.class);
>>>>>    componentInstantiatorSource.addInvalidationListener(service);
>>>>>    return service;
>>>>> }
>>>>>
>>>>> Module methods prefixed with "build" are service builder methods. The
>>>>> service interface is defined from the return value (TranslatorSource).
>>>>> The service id is explicitly "TranslatorSource" (that is, everything
>>>>> after "build" in the method name).
>>>>>
>>>>> Here, Tapestry has injected into the service builder method.
>>>>> ComponentInstantiatorSource is a service that fires events.
>>>>> ServiceResources is something else: it is a bundle of resources
>>>>> related to the service being constructed ... including the ability to
>>>>> instantiate an object including dependencies. What's great here is
>>>>> that buildTranslatorSource() doesn't need to know what the
>>>>> dependencies of TranslatorSourceImpl are, it can instantiate the class
>>>>> with dependencies using the autobuild() method. The service builder
>>>>> then adds the new service as a listener of the
>>>>> ComponentInstantiatorSource, before returning it.
>>>>>
>>>>>
>>>>> 2009/9/23 cleverpig <gr...@gmail.com>:
>>>>>> yes,i'd read it..but i can't get the door to answer...
>>>>>>
>>>>>> On Wed, Sep 23, 2009 at 9:57 AM, Thiago H. de Paula Figueiredo
>>>>>> <th...@gmail.com> wrote:
>>>>>>> Em Tue, 22 Sep 2009 21:55:44 -0300, cleverpig <gr...@gmail.com>
>>>>>>> escreveu:
>>>>>>>
>>>>>>>> oh,thanks for your reply,Alfonso!
>>>>>>>> just now,i get know i need a slf4j implementation.i found a
>>>>>>>> implementation class from slf4j.jar:org.slf4j.impl.Log4jLoggerAdapter.
>>>>>>>> but how to declare the binding of them? what's need to add in the
>>>>>>>> AppModule?
>>>>>>>
>>>>>>> Take a look at
>>>>>>> http://tapestry.apache.org/tapestry5.1/tapestry-ioc/service.html.
>>>>>>>
>>>>>>> --
>>>>>>> Thiago H. de Paula Figueiredo
>>>>>>> Independent Java consultant, developer, and instructor
>>>>>>> http://www.arsmachina.com.br/thiago
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> cleverpig(Dan)
>>>>>> Location: Beijing
>>>>>> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
>>>>>> Zipcode: 100031
>>>>>> MSN: great_liudan@hotmail.com
>>>>>> QQ: 149291732
>>>>>> Skype: cleverpigatmatrix
>>>>>> Facebook ID:cleverpig
>>>>>> Blog: www.cleverpig.name
>>>>>> Tags: del.icio.us/cleverpig
>>>>>> Twitter: twitter.com/cleverpig
>>>>>> 新浪微博: t.sina.com.cn/cleverpig
>>>>>> Organization: www.beijing-open-party.org
>>>>>> Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> cleverpig(Dan)
>>>>> Location: Beijing
>>>>> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
>>>>> Zipcode: 100031
>>>>> MSN: great_liudan@hotmail.com
>>>>> QQ: 149291732
>>>>> Skype: cleverpigatmatrix
>>>>> Facebook ID:cleverpig
>>>>> Blog: www.cleverpig.name
>>>>> Tags: del.icio.us/cleverpig
>>>>> Twitter: twitter.com/cleverpig
>>>>> 新浪微博: t.sina.com.cn/cleverpig
>>>>> Organization: www.beijing-open-party.org
>>>>> Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> cleverpig(Dan)
>>>> Location: Beijing
>>>> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
>>>> Zipcode: 100031
>>>> MSN: great_liudan@hotmail.com
>>>> QQ: 149291732
>>>> Skype: cleverpigatmatrix
>>>> Facebook ID:cleverpig
>>>> Blog: www.cleverpig.name
>>>> Tags: del.icio.us/cleverpig
>>>> Twitter: twitter.com/cleverpig
>>>> 新浪微博: t.sina.com.cn/cleverpig
>>>> Organization: www.beijing-open-party.org
>>>> Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>>>
>>>
>>
>>
>>
>> --
>> cleverpig(Dan)
>> Location: Beijing
>> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
>> Zipcode: 100031
>> MSN: great_liudan@hotmail.com
>> QQ: 149291732
>> Skype: cleverpigatmatrix
>> Facebook ID:cleverpig
>> Blog: www.cleverpig.name
>> Tags: del.icio.us/cleverpig
>> Twitter: twitter.com/cleverpig
>> 新浪微博: t.sina.com.cn/cleverpig
>> Organization: www.beijing-open-party.org
>> Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294
>>
>> ---------------------------------------------------------------------
>> 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
>
>



-- 
cleverpig(Dan)
Location: Beijing
Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
Zipcode: 100031
MSN: great_liudan@hotmail.com
QQ: 149291732
Skype: cleverpigatmatrix
Facebook ID:cleverpig
Blog: www.cleverpig.name
Tags: del.icio.us/cleverpig
Twitter: twitter.com/cleverpig
新浪微博: t.sina.com.cn/cleverpig
Organization: www.beijing-open-party.org
Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294

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


Re: T5:how to inject slf4j service?

Posted by Alfonso Quiroga <al...@gmail.com>.
Cleverpig:
In my AppModule and ServerModule (I have 2 modules) I have nothing
related to logging. I only have "bindings" between services interfaces
and implementations, then I have request filters (hibernate filter),
and finally I have advisors for services (this is like spring
interceptors, but without XML's :)

In my-package.base, I have "BasePage" where I have:

(import org.slf4j.Logger)
    @Inject private Logger logger;

and that's all, I can use that logger (it has getter) in every page
(all of my pages extends BasePage) and it works out of the box, I
don't have to bind anything in modules. Hope it helps

2009/9/23 cleverpig <gr...@gmail.com>:
> hi,Alfonso!
>
> please show me what's in your AppModule..let me get the reality...
>
> 2009/9/23 Alfonso Quiroga <al...@gmail.com>:
>> Is your logging working now? I didn't do anything in AppModule, just
>> drop the jars and logging works, if you still have problems, I can
>> show you my project configuration, good luck
>>
>> 2009/9/23 cleverpig <gr...@gmail.com>:
>>> so,after add the buildLogger function,we can use these code to inject
>>> Logger service:
>>>
>>> Class Start{
>>> ...
>>> @Inject
>>> private Logger log;
>>> ...
>>> }
>>>
>>> On Wed, Sep 23, 2009 at 12:29 PM, cleverpig <gr...@gmail.com> wrote:
>>>> I got the answer! It's so easy...thank all of my helpers and opensource!
>>>>
>>>> my problem's solution:add this function in AppModule class:
>>>>
>>>> public Logger buildLogger(final Logger log){
>>>>        return log;
>>>> }
>>>>
>>>> I'd read this article:http://java.dzone.com/news/tapestry-5-ioc-binding-and-bui,and
>>>> learned what's the secret & key in there:
>>>>
>>>> ---Service Builder Methods---
>>>>
>>>> Sometimes just instantiating a class is not enough; there may be
>>>> additional configuration needed as part of instantiating the class.
>>>> Tapestry 5 IoC's predecessor, HiveMind, accomplished such goals with
>>>> complex service-building services. It ended up being a lot of XML.
>>>>
>>>> T5 IoC accomplishes the same, and more, using service builder methods;
>>>> module methods that construct a service. A typical case is when a
>>>> service implementation needs to listen to events from some other
>>>> service:
>>>>
>>>> public static TranslatorSource
>>>> buildTranslatorSource(ComponentInstantiatorSource
>>>> componentInstantiatorSource,
>>>> ServiceResources resources)
>>>> {
>>>>    TranslatorSourceImpl service =
>>>> resources.autobuild(TranslatorSourceImpl.class);
>>>>    componentInstantiatorSource.addInvalidationListener(service);
>>>>    return service;
>>>> }
>>>>
>>>> Module methods prefixed with "build" are service builder methods. The
>>>> service interface is defined from the return value (TranslatorSource).
>>>> The service id is explicitly "TranslatorSource" (that is, everything
>>>> after "build" in the method name).
>>>>
>>>> Here, Tapestry has injected into the service builder method.
>>>> ComponentInstantiatorSource is a service that fires events.
>>>> ServiceResources is something else: it is a bundle of resources
>>>> related to the service being constructed ... including the ability to
>>>> instantiate an object including dependencies. What's great here is
>>>> that buildTranslatorSource() doesn't need to know what the
>>>> dependencies of TranslatorSourceImpl are, it can instantiate the class
>>>> with dependencies using the autobuild() method. The service builder
>>>> then adds the new service as a listener of the
>>>> ComponentInstantiatorSource, before returning it.
>>>>
>>>>
>>>> 2009/9/23 cleverpig <gr...@gmail.com>:
>>>>> yes,i'd read it..but i can't get the door to answer...
>>>>>
>>>>> On Wed, Sep 23, 2009 at 9:57 AM, Thiago H. de Paula Figueiredo
>>>>> <th...@gmail.com> wrote:
>>>>>> Em Tue, 22 Sep 2009 21:55:44 -0300, cleverpig <gr...@gmail.com>
>>>>>> escreveu:
>>>>>>
>>>>>>> oh,thanks for your reply,Alfonso!
>>>>>>> just now,i get know i need a slf4j implementation.i found a
>>>>>>> implementation class from slf4j.jar:org.slf4j.impl.Log4jLoggerAdapter.
>>>>>>> but how to declare the binding of them? what's need to add in the
>>>>>>> AppModule?
>>>>>>
>>>>>> Take a look at
>>>>>> http://tapestry.apache.org/tapestry5.1/tapestry-ioc/service.html.
>>>>>>
>>>>>> --
>>>>>> Thiago H. de Paula Figueiredo
>>>>>> Independent Java consultant, developer, and instructor
>>>>>> http://www.arsmachina.com.br/thiago
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> cleverpig(Dan)
>>>>> Location: Beijing
>>>>> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
>>>>> Zipcode: 100031
>>>>> MSN: great_liudan@hotmail.com
>>>>> QQ: 149291732
>>>>> Skype: cleverpigatmatrix
>>>>> Facebook ID:cleverpig
>>>>> Blog: www.cleverpig.name
>>>>> Tags: del.icio.us/cleverpig
>>>>> Twitter: twitter.com/cleverpig
>>>>> 新浪微博: t.sina.com.cn/cleverpig
>>>>> Organization: www.beijing-open-party.org
>>>>> Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> cleverpig(Dan)
>>>> Location: Beijing
>>>> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
>>>> Zipcode: 100031
>>>> MSN: great_liudan@hotmail.com
>>>> QQ: 149291732
>>>> Skype: cleverpigatmatrix
>>>> Facebook ID:cleverpig
>>>> Blog: www.cleverpig.name
>>>> Tags: del.icio.us/cleverpig
>>>> Twitter: twitter.com/cleverpig
>>>> 新浪微博: t.sina.com.cn/cleverpig
>>>> Organization: www.beijing-open-party.org
>>>> Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294
>>>>
>>>
>>>
>>>
>>> --
>>> cleverpig(Dan)
>>> Location: Beijing
>>> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
>>> Zipcode: 100031
>>> MSN: great_liudan@hotmail.com
>>> QQ: 149291732
>>> Skype: cleverpigatmatrix
>>> Facebook ID:cleverpig
>>> Blog: www.cleverpig.name
>>> Tags: del.icio.us/cleverpig
>>> Twitter: twitter.com/cleverpig
>>> 新浪微博: t.sina.com.cn/cleverpig
>>> Organization: www.beijing-open-party.org
>>> Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>
>>
>
>
>
> --
> cleverpig(Dan)
> Location: Beijing
> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
> Zipcode: 100031
> MSN: great_liudan@hotmail.com
> QQ: 149291732
> Skype: cleverpigatmatrix
> Facebook ID:cleverpig
> Blog: www.cleverpig.name
> Tags: del.icio.us/cleverpig
> Twitter: twitter.com/cleverpig
> 新浪微博: t.sina.com.cn/cleverpig
> Organization: www.beijing-open-party.org
> Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294
>
> ---------------------------------------------------------------------
> 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:how to inject slf4j service?

Posted by cleverpig <gr...@gmail.com>.
hi,Alfonso!

please show me what's in your AppModule..let me get the reality...

2009/9/23 Alfonso Quiroga <al...@gmail.com>:
> Is your logging working now? I didn't do anything in AppModule, just
> drop the jars and logging works, if you still have problems, I can
> show you my project configuration, good luck
>
> 2009/9/23 cleverpig <gr...@gmail.com>:
>> so,after add the buildLogger function,we can use these code to inject
>> Logger service:
>>
>> Class Start{
>> ...
>> @Inject
>> private Logger log;
>> ...
>> }
>>
>> On Wed, Sep 23, 2009 at 12:29 PM, cleverpig <gr...@gmail.com> wrote:
>>> I got the answer! It's so easy...thank all of my helpers and opensource!
>>>
>>> my problem's solution:add this function in AppModule class:
>>>
>>> public Logger buildLogger(final Logger log){
>>>        return log;
>>> }
>>>
>>> I'd read this article:http://java.dzone.com/news/tapestry-5-ioc-binding-and-bui,and
>>> learned what's the secret & key in there:
>>>
>>> ---Service Builder Methods---
>>>
>>> Sometimes just instantiating a class is not enough; there may be
>>> additional configuration needed as part of instantiating the class.
>>> Tapestry 5 IoC's predecessor, HiveMind, accomplished such goals with
>>> complex service-building services. It ended up being a lot of XML.
>>>
>>> T5 IoC accomplishes the same, and more, using service builder methods;
>>> module methods that construct a service. A typical case is when a
>>> service implementation needs to listen to events from some other
>>> service:
>>>
>>> public static TranslatorSource
>>> buildTranslatorSource(ComponentInstantiatorSource
>>> componentInstantiatorSource,
>>> ServiceResources resources)
>>> {
>>>    TranslatorSourceImpl service =
>>> resources.autobuild(TranslatorSourceImpl.class);
>>>    componentInstantiatorSource.addInvalidationListener(service);
>>>    return service;
>>> }
>>>
>>> Module methods prefixed with "build" are service builder methods. The
>>> service interface is defined from the return value (TranslatorSource).
>>> The service id is explicitly "TranslatorSource" (that is, everything
>>> after "build" in the method name).
>>>
>>> Here, Tapestry has injected into the service builder method.
>>> ComponentInstantiatorSource is a service that fires events.
>>> ServiceResources is something else: it is a bundle of resources
>>> related to the service being constructed ... including the ability to
>>> instantiate an object including dependencies. What's great here is
>>> that buildTranslatorSource() doesn't need to know what the
>>> dependencies of TranslatorSourceImpl are, it can instantiate the class
>>> with dependencies using the autobuild() method. The service builder
>>> then adds the new service as a listener of the
>>> ComponentInstantiatorSource, before returning it.
>>>
>>>
>>> 2009/9/23 cleverpig <gr...@gmail.com>:
>>>> yes,i'd read it..but i can't get the door to answer...
>>>>
>>>> On Wed, Sep 23, 2009 at 9:57 AM, Thiago H. de Paula Figueiredo
>>>> <th...@gmail.com> wrote:
>>>>> Em Tue, 22 Sep 2009 21:55:44 -0300, cleverpig <gr...@gmail.com>
>>>>> escreveu:
>>>>>
>>>>>> oh,thanks for your reply,Alfonso!
>>>>>> just now,i get know i need a slf4j implementation.i found a
>>>>>> implementation class from slf4j.jar:org.slf4j.impl.Log4jLoggerAdapter.
>>>>>> but how to declare the binding of them? what's need to add in the
>>>>>> AppModule?
>>>>>
>>>>> Take a look at
>>>>> http://tapestry.apache.org/tapestry5.1/tapestry-ioc/service.html.
>>>>>
>>>>> --
>>>>> Thiago H. de Paula Figueiredo
>>>>> Independent Java consultant, developer, and instructor
>>>>> http://www.arsmachina.com.br/thiago
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> cleverpig(Dan)
>>>> Location: Beijing
>>>> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
>>>> Zipcode: 100031
>>>> MSN: great_liudan@hotmail.com
>>>> QQ: 149291732
>>>> Skype: cleverpigatmatrix
>>>> Facebook ID:cleverpig
>>>> Blog: www.cleverpig.name
>>>> Tags: del.icio.us/cleverpig
>>>> Twitter: twitter.com/cleverpig
>>>> 新浪微博: t.sina.com.cn/cleverpig
>>>> Organization: www.beijing-open-party.org
>>>> Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294
>>>>
>>>
>>>
>>>
>>> --
>>> cleverpig(Dan)
>>> Location: Beijing
>>> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
>>> Zipcode: 100031
>>> MSN: great_liudan@hotmail.com
>>> QQ: 149291732
>>> Skype: cleverpigatmatrix
>>> Facebook ID:cleverpig
>>> Blog: www.cleverpig.name
>>> Tags: del.icio.us/cleverpig
>>> Twitter: twitter.com/cleverpig
>>> 新浪微博: t.sina.com.cn/cleverpig
>>> Organization: www.beijing-open-party.org
>>> Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294
>>>
>>
>>
>>
>> --
>> cleverpig(Dan)
>> Location: Beijing
>> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
>> Zipcode: 100031
>> MSN: great_liudan@hotmail.com
>> QQ: 149291732
>> Skype: cleverpigatmatrix
>> Facebook ID:cleverpig
>> Blog: www.cleverpig.name
>> Tags: del.icio.us/cleverpig
>> Twitter: twitter.com/cleverpig
>> 新浪微博: t.sina.com.cn/cleverpig
>> Organization: www.beijing-open-party.org
>> Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294
>>
>> ---------------------------------------------------------------------
>> 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
>
>



-- 
cleverpig(Dan)
Location: Beijing
Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
Zipcode: 100031
MSN: great_liudan@hotmail.com
QQ: 149291732
Skype: cleverpigatmatrix
Facebook ID:cleverpig
Blog: www.cleverpig.name
Tags: del.icio.us/cleverpig
Twitter: twitter.com/cleverpig
新浪微博: t.sina.com.cn/cleverpig
Organization: www.beijing-open-party.org
Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294

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


Re: T5:how to inject slf4j service?

Posted by Alfonso Quiroga <al...@gmail.com>.
Is your logging working now? I didn't do anything in AppModule, just
drop the jars and logging works, if you still have problems, I can
show you my project configuration, good luck

2009/9/23 cleverpig <gr...@gmail.com>:
> so,after add the buildLogger function,we can use these code to inject
> Logger service:
>
> Class Start{
> ...
> @Inject
> private Logger log;
> ...
> }
>
> On Wed, Sep 23, 2009 at 12:29 PM, cleverpig <gr...@gmail.com> wrote:
>> I got the answer! It's so easy...thank all of my helpers and opensource!
>>
>> my problem's solution:add this function in AppModule class:
>>
>> public Logger buildLogger(final Logger log){
>>        return log;
>> }
>>
>> I'd read this article:http://java.dzone.com/news/tapestry-5-ioc-binding-and-bui,and
>> learned what's the secret & key in there:
>>
>> ---Service Builder Methods---
>>
>> Sometimes just instantiating a class is not enough; there may be
>> additional configuration needed as part of instantiating the class.
>> Tapestry 5 IoC's predecessor, HiveMind, accomplished such goals with
>> complex service-building services. It ended up being a lot of XML.
>>
>> T5 IoC accomplishes the same, and more, using service builder methods;
>> module methods that construct a service. A typical case is when a
>> service implementation needs to listen to events from some other
>> service:
>>
>> public static TranslatorSource
>> buildTranslatorSource(ComponentInstantiatorSource
>> componentInstantiatorSource,
>> ServiceResources resources)
>> {
>>    TranslatorSourceImpl service =
>> resources.autobuild(TranslatorSourceImpl.class);
>>    componentInstantiatorSource.addInvalidationListener(service);
>>    return service;
>> }
>>
>> Module methods prefixed with "build" are service builder methods. The
>> service interface is defined from the return value (TranslatorSource).
>> The service id is explicitly "TranslatorSource" (that is, everything
>> after "build" in the method name).
>>
>> Here, Tapestry has injected into the service builder method.
>> ComponentInstantiatorSource is a service that fires events.
>> ServiceResources is something else: it is a bundle of resources
>> related to the service being constructed ... including the ability to
>> instantiate an object including dependencies. What's great here is
>> that buildTranslatorSource() doesn't need to know what the
>> dependencies of TranslatorSourceImpl are, it can instantiate the class
>> with dependencies using the autobuild() method. The service builder
>> then adds the new service as a listener of the
>> ComponentInstantiatorSource, before returning it.
>>
>>
>> 2009/9/23 cleverpig <gr...@gmail.com>:
>>> yes,i'd read it..but i can't get the door to answer...
>>>
>>> On Wed, Sep 23, 2009 at 9:57 AM, Thiago H. de Paula Figueiredo
>>> <th...@gmail.com> wrote:
>>>> Em Tue, 22 Sep 2009 21:55:44 -0300, cleverpig <gr...@gmail.com>
>>>> escreveu:
>>>>
>>>>> oh,thanks for your reply,Alfonso!
>>>>> just now,i get know i need a slf4j implementation.i found a
>>>>> implementation class from slf4j.jar:org.slf4j.impl.Log4jLoggerAdapter.
>>>>> but how to declare the binding of them? what's need to add in the
>>>>> AppModule?
>>>>
>>>> Take a look at
>>>> http://tapestry.apache.org/tapestry5.1/tapestry-ioc/service.html.
>>>>
>>>> --
>>>> Thiago H. de Paula Figueiredo
>>>> Independent Java consultant, developer, and instructor
>>>> http://www.arsmachina.com.br/thiago
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> cleverpig(Dan)
>>> Location: Beijing
>>> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
>>> Zipcode: 100031
>>> MSN: great_liudan@hotmail.com
>>> QQ: 149291732
>>> Skype: cleverpigatmatrix
>>> Facebook ID:cleverpig
>>> Blog: www.cleverpig.name
>>> Tags: del.icio.us/cleverpig
>>> Twitter: twitter.com/cleverpig
>>> 新浪微博: t.sina.com.cn/cleverpig
>>> Organization: www.beijing-open-party.org
>>> Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294
>>>
>>
>>
>>
>> --
>> cleverpig(Dan)
>> Location: Beijing
>> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
>> Zipcode: 100031
>> MSN: great_liudan@hotmail.com
>> QQ: 149291732
>> Skype: cleverpigatmatrix
>> Facebook ID:cleverpig
>> Blog: www.cleverpig.name
>> Tags: del.icio.us/cleverpig
>> Twitter: twitter.com/cleverpig
>> 新浪微博: t.sina.com.cn/cleverpig
>> Organization: www.beijing-open-party.org
>> Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294
>>
>
>
>
> --
> cleverpig(Dan)
> Location: Beijing
> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
> Zipcode: 100031
> MSN: great_liudan@hotmail.com
> QQ: 149291732
> Skype: cleverpigatmatrix
> Facebook ID:cleverpig
> Blog: www.cleverpig.name
> Tags: del.icio.us/cleverpig
> Twitter: twitter.com/cleverpig
> 新浪微博: t.sina.com.cn/cleverpig
> Organization: www.beijing-open-party.org
> Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294
>
> ---------------------------------------------------------------------
> 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:how to inject slf4j service?

Posted by cleverpig <gr...@gmail.com>.
so,after add the buildLogger function,we can use these code to inject
Logger service:

Class Start{
...
@Inject
private Logger log;
...
}

On Wed, Sep 23, 2009 at 12:29 PM, cleverpig <gr...@gmail.com> wrote:
> I got the answer! It's so easy...thank all of my helpers and opensource!
>
> my problem's solution:add this function in AppModule class:
>
> public Logger buildLogger(final Logger log){
>        return log;
> }
>
> I'd read this article:http://java.dzone.com/news/tapestry-5-ioc-binding-and-bui,and
> learned what's the secret & key in there:
>
> ---Service Builder Methods---
>
> Sometimes just instantiating a class is not enough; there may be
> additional configuration needed as part of instantiating the class.
> Tapestry 5 IoC's predecessor, HiveMind, accomplished such goals with
> complex service-building services. It ended up being a lot of XML.
>
> T5 IoC accomplishes the same, and more, using service builder methods;
> module methods that construct a service. A typical case is when a
> service implementation needs to listen to events from some other
> service:
>
> public static TranslatorSource
> buildTranslatorSource(ComponentInstantiatorSource
> componentInstantiatorSource,
> ServiceResources resources)
> {
>    TranslatorSourceImpl service =
> resources.autobuild(TranslatorSourceImpl.class);
>    componentInstantiatorSource.addInvalidationListener(service);
>    return service;
> }
>
> Module methods prefixed with "build" are service builder methods. The
> service interface is defined from the return value (TranslatorSource).
> The service id is explicitly "TranslatorSource" (that is, everything
> after "build" in the method name).
>
> Here, Tapestry has injected into the service builder method.
> ComponentInstantiatorSource is a service that fires events.
> ServiceResources is something else: it is a bundle of resources
> related to the service being constructed ... including the ability to
> instantiate an object including dependencies. What's great here is
> that buildTranslatorSource() doesn't need to know what the
> dependencies of TranslatorSourceImpl are, it can instantiate the class
> with dependencies using the autobuild() method. The service builder
> then adds the new service as a listener of the
> ComponentInstantiatorSource, before returning it.
>
>
> 2009/9/23 cleverpig <gr...@gmail.com>:
>> yes,i'd read it..but i can't get the door to answer...
>>
>> On Wed, Sep 23, 2009 at 9:57 AM, Thiago H. de Paula Figueiredo
>> <th...@gmail.com> wrote:
>>> Em Tue, 22 Sep 2009 21:55:44 -0300, cleverpig <gr...@gmail.com>
>>> escreveu:
>>>
>>>> oh,thanks for your reply,Alfonso!
>>>> just now,i get know i need a slf4j implementation.i found a
>>>> implementation class from slf4j.jar:org.slf4j.impl.Log4jLoggerAdapter.
>>>> but how to declare the binding of them? what's need to add in the
>>>> AppModule?
>>>
>>> Take a look at
>>> http://tapestry.apache.org/tapestry5.1/tapestry-ioc/service.html.
>>>
>>> --
>>> Thiago H. de Paula Figueiredo
>>> Independent Java consultant, developer, and instructor
>>> http://www.arsmachina.com.br/thiago
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>
>>
>>
>> --
>> cleverpig(Dan)
>> Location: Beijing
>> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
>> Zipcode: 100031
>> MSN: great_liudan@hotmail.com
>> QQ: 149291732
>> Skype: cleverpigatmatrix
>> Facebook ID:cleverpig
>> Blog: www.cleverpig.name
>> Tags: del.icio.us/cleverpig
>> Twitter: twitter.com/cleverpig
>> 新浪微博: t.sina.com.cn/cleverpig
>> Organization: www.beijing-open-party.org
>> Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294
>>
>
>
>
> --
> cleverpig(Dan)
> Location: Beijing
> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
> Zipcode: 100031
> MSN: great_liudan@hotmail.com
> QQ: 149291732
> Skype: cleverpigatmatrix
> Facebook ID:cleverpig
> Blog: www.cleverpig.name
> Tags: del.icio.us/cleverpig
> Twitter: twitter.com/cleverpig
> 新浪微博: t.sina.com.cn/cleverpig
> Organization: www.beijing-open-party.org
> Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294
>



-- 
cleverpig(Dan)
Location: Beijing
Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
Zipcode: 100031
MSN: great_liudan@hotmail.com
QQ: 149291732
Skype: cleverpigatmatrix
Facebook ID:cleverpig
Blog: www.cleverpig.name
Tags: del.icio.us/cleverpig
Twitter: twitter.com/cleverpig
新浪微博: t.sina.com.cn/cleverpig
Organization: www.beijing-open-party.org
Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294

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


Re: T5:how to inject slf4j service?

Posted by cleverpig <gr...@gmail.com>.
I got the answer! It's so easy...thank all of my helpers and opensource!

my problem's solution:add this function in AppModule class:

public Logger buildLogger(final Logger log){
    	return log;
}

I'd read this article:http://java.dzone.com/news/tapestry-5-ioc-binding-and-bui,and
learned what's the secret & key in there:

---Service Builder Methods---

Sometimes just instantiating a class is not enough; there may be
additional configuration needed as part of instantiating the class.
Tapestry 5 IoC's predecessor, HiveMind, accomplished such goals with
complex service-building services. It ended up being a lot of XML.

T5 IoC accomplishes the same, and more, using service builder methods;
module methods that construct a service. A typical case is when a
service implementation needs to listen to events from some other
service:

public static TranslatorSource
buildTranslatorSource(ComponentInstantiatorSource
componentInstantiatorSource,
ServiceResources resources)
{
    TranslatorSourceImpl service =
resources.autobuild(TranslatorSourceImpl.class);
    componentInstantiatorSource.addInvalidationListener(service);
    return service;
}

Module methods prefixed with "build" are service builder methods. The
service interface is defined from the return value (TranslatorSource).
The service id is explicitly "TranslatorSource" (that is, everything
after "build" in the method name).

Here, Tapestry has injected into the service builder method.
ComponentInstantiatorSource is a service that fires events.
ServiceResources is something else: it is a bundle of resources
related to the service being constructed ... including the ability to
instantiate an object including dependencies. What's great here is
that buildTranslatorSource() doesn't need to know what the
dependencies of TranslatorSourceImpl are, it can instantiate the class
with dependencies using the autobuild() method. The service builder
then adds the new service as a listener of the
ComponentInstantiatorSource, before returning it.


2009/9/23 cleverpig <gr...@gmail.com>:
> yes,i'd read it..but i can't get the door to answer...
>
> On Wed, Sep 23, 2009 at 9:57 AM, Thiago H. de Paula Figueiredo
> <th...@gmail.com> wrote:
>> Em Tue, 22 Sep 2009 21:55:44 -0300, cleverpig <gr...@gmail.com>
>> escreveu:
>>
>>> oh,thanks for your reply,Alfonso!
>>> just now,i get know i need a slf4j implementation.i found a
>>> implementation class from slf4j.jar:org.slf4j.impl.Log4jLoggerAdapter.
>>> but how to declare the binding of them? what's need to add in the
>>> AppModule?
>>
>> Take a look at
>> http://tapestry.apache.org/tapestry5.1/tapestry-ioc/service.html.
>>
>> --
>> Thiago H. de Paula Figueiredo
>> Independent Java consultant, developer, and instructor
>> http://www.arsmachina.com.br/thiago
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>
>
> --
> cleverpig(Dan)
> Location: Beijing
> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
> Zipcode: 100031
> MSN: great_liudan@hotmail.com
> QQ: 149291732
> Skype: cleverpigatmatrix
> Facebook ID:cleverpig
> Blog: www.cleverpig.name
> Tags: del.icio.us/cleverpig
> Twitter: twitter.com/cleverpig
> 新浪微博: t.sina.com.cn/cleverpig
> Organization: www.beijing-open-party.org
> Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294
>



-- 
cleverpig(Dan)
Location: Beijing
Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
Zipcode: 100031
MSN: great_liudan@hotmail.com
QQ: 149291732
Skype: cleverpigatmatrix
Facebook ID:cleverpig
Blog: www.cleverpig.name
Tags: del.icio.us/cleverpig
Twitter: twitter.com/cleverpig
新浪微博: t.sina.com.cn/cleverpig
Organization: www.beijing-open-party.org
Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294

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


Re: T5:how to inject slf4j service?

Posted by cleverpig <gr...@gmail.com>.
yes,i'd read it..but i can't get the door to answer...

On Wed, Sep 23, 2009 at 9:57 AM, Thiago H. de Paula Figueiredo
<th...@gmail.com> wrote:
> Em Tue, 22 Sep 2009 21:55:44 -0300, cleverpig <gr...@gmail.com>
> escreveu:
>
>> oh,thanks for your reply,Alfonso!
>> just now,i get know i need a slf4j implementation.i found a
>> implementation class from slf4j.jar:org.slf4j.impl.Log4jLoggerAdapter.
>> but how to declare the binding of them? what's need to add in the
>> AppModule?
>
> Take a look at
> http://tapestry.apache.org/tapestry5.1/tapestry-ioc/service.html.
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
cleverpig(Dan)
Location: Beijing
Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
Zipcode: 100031
MSN: great_liudan@hotmail.com
QQ: 149291732
Skype: cleverpigatmatrix
Facebook ID:cleverpig
Blog: www.cleverpig.name
Tags: del.icio.us/cleverpig
Twitter: twitter.com/cleverpig
新浪微博: t.sina.com.cn/cleverpig
Organization: www.beijing-open-party.org
Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294

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


Re: T5:how to inject slf4j service?

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Tue, 22 Sep 2009 21:55:44 -0300, cleverpig <gr...@gmail.com>  
escreveu:

> oh,thanks for your reply,Alfonso!
> just now,i get know i need a slf4j implementation.i found a
> implementation class from slf4j.jar:org.slf4j.impl.Log4jLoggerAdapter.
> but how to declare the binding of them? what's need to add in the  
> AppModule?

Take a look at  
http://tapestry.apache.org/tapestry5.1/tapestry-ioc/service.html.

-- 
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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


Re: T5:how to inject slf4j service?

Posted by cleverpig <gr...@gmail.com>.
oh,thanks for your reply,Alfonso!
just now,i get know i need a slf4j implementation.i found a
implementation class from slf4j.jar:org.slf4j.impl.Log4jLoggerAdapter.
but how to declare the binding of them? what's need to add in the AppModule?
you get work with slf4j & tapestry5?please show me some example... :)

On Wed, Sep 23, 2009 at 1:31 AM, Alfonso Quiroga <al...@gmail.com> wrote:
> You need an implementation of slf4j, there are a lot. I use
> slf4j-log4j12.1.5.2 (it's a bridge between slf4j and log4j)
>
> Check this blog:
> http://fernandoribeiro.eti.br/2006/05/24/how-to-use-slf4j-with-log4j/
>
> On Tue, Sep 22, 2009 at 4:36 AM, cleverpig <gr...@gmail.com> wrote:
>> I checked slf4j sourcecode,there has a Logger interface
>> implement:org.slf4j.impl.Log4jLoggerAdapter
>> but how to bind them together and make a inject? need improve
>> AppModule's function?
>> I don't know why tapestry hadn't done it for user? need help too...
>>
>> On Tue, Sep 22, 2009 at 11:16 AM, cleverpig <gr...@gmail.com> wrote:
>>> i always use log4j for a long time.and now i will change to new weapon--slf4j!
>>>
>>> i use @inject annotation to request this slf4j logging service:
>>> public class Start{
>>> ...
>>>        @Inject
>>>        private Logger log;
>>> ...
>>> }
>>> but got a expection:
>>> No service implements the interface org.slf4j.Logger
>>> ...
>>>
>>> i found some little words about
>>> slf4j:http://tapestry.apache.org/tapestry5.1/guide/logging.html
>>>
>>> "Logging of Tapestry Components and Pages
>>> Tapestry makes extensive use of SLF4J to log details about the
>>> creation and operation of your page and component classes.
>>> The default configuration for logging uses Log4J as the logging
>>> toolkit, though this can be changed."
>>>
>>> but "this can be changed" page link is invalid.
>>>
>>> somebody help me?give me example to fire a light in my darkness. :)
>>>
>>> --
>>> cleverpig(Dan)
>>> Location: Beijing
>>> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
>>> Zipcode: 100031
>>> MSN: great_liudan@hotmail.com
>>> QQ: 149291732
>>> Skype: cleverpigatmatrix
>>> Facebook ID:cleverpig
>>> Blog: www.cleverpig.name
>>> Tags: del.icio.us/cleverpig
>>> Twitter: twitter.com/cleverpig
>>> 新浪微博: t.sina.com.cn/cleverpig
>>> Organization: www.beijing-open-party.org
>>> Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294
>>>
>>
>>
>>
>> --
>> cleverpig(Dan)
>> Location: Beijing
>> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
>> Zipcode: 100031
>> MSN: great_liudan@hotmail.com
>> QQ: 149291732
>> Skype: cleverpigatmatrix
>> Facebook ID:cleverpig
>> Blog: www.cleverpig.name
>> Tags: del.icio.us/cleverpig
>> Twitter: twitter.com/cleverpig
>> 新浪微博: t.sina.com.cn/cleverpig
>> Organization: www.beijing-open-party.org
>> Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294
>>
>> ---------------------------------------------------------------------
>> 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
>
>



-- 
cleverpig(Dan)
Location: Beijing
Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
Zipcode: 100031
MSN: great_liudan@hotmail.com
QQ: 149291732
Skype: cleverpigatmatrix
Facebook ID:cleverpig
Blog: www.cleverpig.name
Tags: del.icio.us/cleverpig
Twitter: twitter.com/cleverpig
新浪微博: t.sina.com.cn/cleverpig
Organization: www.beijing-open-party.org
Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294

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


Re: T5:how to inject slf4j service?

Posted by Alfonso Quiroga <al...@gmail.com>.
You need an implementation of slf4j, there are a lot. I use
slf4j-log4j12.1.5.2 (it's a bridge between slf4j and log4j)

Check this blog:
http://fernandoribeiro.eti.br/2006/05/24/how-to-use-slf4j-with-log4j/

On Tue, Sep 22, 2009 at 4:36 AM, cleverpig <gr...@gmail.com> wrote:
> I checked slf4j sourcecode,there has a Logger interface
> implement:org.slf4j.impl.Log4jLoggerAdapter
> but how to bind them together and make a inject? need improve
> AppModule's function?
> I don't know why tapestry hadn't done it for user? need help too...
>
> On Tue, Sep 22, 2009 at 11:16 AM, cleverpig <gr...@gmail.com> wrote:
>> i always use log4j for a long time.and now i will change to new weapon--slf4j!
>>
>> i use @inject annotation to request this slf4j logging service:
>> public class Start{
>> ...
>>        @Inject
>>        private Logger log;
>> ...
>> }
>> but got a expection:
>> No service implements the interface org.slf4j.Logger
>> ...
>>
>> i found some little words about
>> slf4j:http://tapestry.apache.org/tapestry5.1/guide/logging.html
>>
>> "Logging of Tapestry Components and Pages
>> Tapestry makes extensive use of SLF4J to log details about the
>> creation and operation of your page and component classes.
>> The default configuration for logging uses Log4J as the logging
>> toolkit, though this can be changed."
>>
>> but "this can be changed" page link is invalid.
>>
>> somebody help me?give me example to fire a light in my darkness. :)
>>
>> --
>> cleverpig(Dan)
>> Location: Beijing
>> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
>> Zipcode: 100031
>> MSN: great_liudan@hotmail.com
>> QQ: 149291732
>> Skype: cleverpigatmatrix
>> Facebook ID:cleverpig
>> Blog: www.cleverpig.name
>> Tags: del.icio.us/cleverpig
>> Twitter: twitter.com/cleverpig
>> 新浪微博: t.sina.com.cn/cleverpig
>> Organization: www.beijing-open-party.org
>> Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294
>>
>
>
>
> --
> cleverpig(Dan)
> Location: Beijing
> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
> Zipcode: 100031
> MSN: great_liudan@hotmail.com
> QQ: 149291732
> Skype: cleverpigatmatrix
> Facebook ID:cleverpig
> Blog: www.cleverpig.name
> Tags: del.icio.us/cleverpig
> Twitter: twitter.com/cleverpig
> 新浪微博: t.sina.com.cn/cleverpig
> Organization: www.beijing-open-party.org
> Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294
>
> ---------------------------------------------------------------------
> 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:how to inject slf4j service?

Posted by cleverpig <gr...@gmail.com>.
I checked slf4j sourcecode,there has a Logger interface
implement:org.slf4j.impl.Log4jLoggerAdapter
but how to bind them together and make a inject? need improve
AppModule's function?
I don't know why tapestry hadn't done it for user? need help too...

On Tue, Sep 22, 2009 at 11:16 AM, cleverpig <gr...@gmail.com> wrote:
> i always use log4j for a long time.and now i will change to new weapon--slf4j!
>
> i use @inject annotation to request this slf4j logging service:
> public class Start{
> ...
>        @Inject
>        private Logger log;
> ...
> }
> but got a expection:
> No service implements the interface org.slf4j.Logger
> ...
>
> i found some little words about
> slf4j:http://tapestry.apache.org/tapestry5.1/guide/logging.html
>
> "Logging of Tapestry Components and Pages
> Tapestry makes extensive use of SLF4J to log details about the
> creation and operation of your page and component classes.
> The default configuration for logging uses Log4J as the logging
> toolkit, though this can be changed."
>
> but "this can be changed" page link is invalid.
>
> somebody help me?give me example to fire a light in my darkness. :)
>
> --
> cleverpig(Dan)
> Location: Beijing
> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
> Zipcode: 100031
> MSN: great_liudan@hotmail.com
> QQ: 149291732
> Skype: cleverpigatmatrix
> Facebook ID:cleverpig
> Blog: www.cleverpig.name
> Tags: del.icio.us/cleverpig
> Twitter: twitter.com/cleverpig
> 新浪微博: t.sina.com.cn/cleverpig
> Organization: www.beijing-open-party.org
> Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294
>



-- 
cleverpig(Dan)
Location: Beijing
Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
Zipcode: 100031
MSN: great_liudan@hotmail.com
QQ: 149291732
Skype: cleverpigatmatrix
Facebook ID:cleverpig
Blog: www.cleverpig.name
Tags: del.icio.us/cleverpig
Twitter: twitter.com/cleverpig
新浪微博: t.sina.com.cn/cleverpig
Organization: www.beijing-open-party.org
Organ@Facebook: http://www.facebook.com/group.php?gid=8159558294

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