The trinidad logger wraps the JDK one.
It internally looksup a resourcebundle and with
getMessage("SomeKey",...) you get the translated
msg, which you put into methods like warning(String);
On Dec 15, 2007 7:59 PM, simon <[EMAIL PROTECTED]> wrote:
> The issue is that Trinidad (ADF faces) has always emitted
> internationalised log messages, by using its own logging implementation.
>
> But commons-logging does not offer any help for that. If code wants to
> emit a log message that can be internationalised, it looks like this:
>
> if (log.isDebugEnabled()) {
> String msg = TrinidadMsgFormatter.format("SomeMsgKey", arg1, arg2);
> log.debug(msg);
> }
>
> This is certainly inconvenient.
>
> The slf4j equivalent looks like this:
> log.debug("SomeMsgKey", arg1, arg2);
> which at initial glance seems nicer.
>
> However there are a number of gotchas. The most important is how the
> resources are found to map (key, args) to a sensible message.
>
> If the underlying logging implementation is i18n-aware then SLF4j jus
> tpasses the data on. But the underlying impl still needs to somehow know
> how to find the Trinidad resource bundles in order to create sensible
> logging messages. I don't have any experience with i18n-aware logging
> systems, so I'll leave that to others to comment on how easy/difficult
> it is to arrange that.
>
> But AFAIK if the underlying logging implementation is *not* i18n-aware,
> then the message written to the log will simply be "SomeMsgKey", with
> all info about the actual params lost. This, for example, is the default
> SLF4J behaviour when configured to forward messages to commons-logging
> or log4j.
>
> Regards,
>
> Simon
>
>
> On Sat, 2007-12-15 at 18:32 +0000, Bruno Aranda wrote:
> > And sorry, I do not know sl4j, what do we gain with it? Thanks!
> >
> > Bruno
> >
> > On 15 Dec 2007 19:26:00 +0100, Mario Ivankovits <[EMAIL PROTECTED]> wrote:
> > > could you explain what we gain from that switch?
> > >
> > > I just see one additional jar as the user has to deal with cl anyway.
> > >
> > > It is the defacto standard.
> > >
> > > Did you consider the java std log facility. Might be as good as sl4j.
> > > A cl adapter might be doable there too.
> > >
> > >
> > >
> > > Mario
> > >
> > > -----Original Message-----
> > > From: "Matthias Wessendorf" <[EMAIL PROTECTED]>
> > > Date: Saturday, Dez 15, 2007 7:12 pm
> > > Subject: Re: [commons] What Logger ?
> > > To: "MyFaces Development" <[email protected]>, [EMAIL PROTECTED]
> > >
> > > I think, that Manfredo will also put it into myfaces-core
> > > >:-)
> > > >
> > > >Simon suggested to create a MyFaces Logger,
> > > >but... commons should not depend on that.
> > > >
> > > >(a cool discussion on the hackaton)
> > > >
> > > >-M
> > > >
> > > >On 15 Dec 2007 19:01:00 +0100, Mario Ivankovits <[EMAIL PROTECTED]>
> > > >wrote:
> > > >
> > > >> does this mean EVERY user has to drop in a slf4j jar then?
> > > > Why not stick with cl and those willing to use sl4j drop in the adapter
> > > > jar?
> > > >
> > > >>
> > > > Mario
> > > >
> > > >>
> > > > -----Original Message-----
> > > > From: "Matthias Wessendorf" <[EMAIL PROTECTED]>
> > > > Date: Saturday, Dez 15, 2007 5:53 pm
> > > > Subject: [commons] What Logger ?
> > > > To: Reply- "MyFaces Development" <[email protected]>To:
> > > > "MyFaces Development" <[email protected]>
> > > >
> > > >> Hi,
> > > > >
> > > > >I think, I'll use http://slf4j.org/ for the logger in commons.
> > > > >
> > > > >What do you think about that ?
> > > > >
> > > > >-M
> > > > >
> > > > >--
> > > > >Matthias Wessendorf
> > > > >
> > > > >further stuff:
> > > > >blog: http://matthiaswessendorf.wordpress.com/
> > > > >sessions: http://www.slideshare.net/mwessendorf
> > > > >mail: matzew-at-apache-dot-org
> > > > >
> > > > >
> > > >
> > > >>
> > > >
> > > >
> > > >
> > > >--
> > > >Matthias Wessendorf
> > > >
> > > >further stuff:
> > > >blog: http://matthiaswessendorf.wordpress.com/
> > > >sessions: http://www.slideshare.net/mwessendorf
> > > >mail: matzew-at-apache-dot-org
> > > >
> > > >
> > >
> > >
>
>
--
Matthias Wessendorf
further stuff:
blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
mail: matzew-at-apache-dot-org