On Thursday 06 March 2008, John-M Baker wrote:
> Well I'm not sure it's a lot of extra effort changing code - I wrote a
> Perl script to modify my project and after a few minutes of fixing the
> search/replaces that went wrong, I had commons-logging in place.
>
> I don't know anything about the i8n method so can't really comment. I
> was under the impression commons-logging passed on log messages to the
> underlying API.
That's the main point. In j.u.l, we can associate a ResourceBundle to
the Logger and if the message should be logged, it will use the
ResourceBundle to lookup and format the message and parameters. We
can call:
LOG.warning("NOT_FOUND", param1, param2);
and the logger will lookup the correct message for NOT_FOUND, format it
with the params, and then log it. With commons logging, there isn't a
way to assocate the ResourceBundle. Thus, the code to do that would all
have to be moved into the CXF code. Thus, the single line above
changes to:
if (LOG.isWarnEnabled()) {
String msg = resourceBundle.getString("NOT_FOUND");
msg = MessageFormat.format(msg, param1, param2);
LOG.warn(msg);
}
Thus, the logging code starts taking up much more of a % of the "real"
code. And flipping to that format WOULD take a significant amount of
work.
Dan
>
>
> John Baker
> --
> Web SSO
> IT Infrastructure
> Deutsche Bank London
>
> URL: http://websso.cto.gt.intranet.db.com
>
>
>
>
> Daniel Kulp <[EMAIL PROTECTED]>
> 06/03/2008 15:21
>
> To
> [email protected]
> cc
> John-M Baker/ext/[EMAIL PROTECTED]
> Subject
> Re: CXF logging
>
> On Thursday 06 March 2008, John-M Baker wrote:
> > Wouldn't it make sense to use commons logging? I implemented it on
> > some code recently and it seems a bit of a no brainer...
>
> It would be a huge amount of work to switch over and commons logging
> does not support the i18n methods of logging that j.u.l supports that
> we rely on heavily thus requiring either a wrapper to be created or a
> LOT of extra code to be added to all the logging in CXF.
>
> Dan
>
> > John Baker
> > --
> > Web SSO
> > IT Infrastructure
> > Deutsche Bank London
> >
> > URL: http://websso.cto.gt.intranet.db.com
> >
> >
> >
> >
> > Daniel Kulp <[EMAIL PROTECTED]>
> > 06/03/2008 15:12
> > Please respond to
> > [email protected]
> >
> >
> > To
> > [email protected]
> > cc
> > John-M Baker/ext/[EMAIL PROTECTED]
> > Subject
> > Re: CXF logging
> >
> > On Thursday 06 March 2008, John-M Baker wrote:
> > > So does it not use log4j by default? Or commons logging, rather?
> >
> > No... commons-logging is there cause a couple of dependencies
> > require it (spring, maybe jetty). By default, it's straight
> > java.util.logging.
> >
> > Dan
> >
> > > John Baker
> > > --
> > > Web SSO
> > > IT Infrastructure
> > > Deutsche Bank London
> > >
> > > URL: http://websso.cto.gt.intranet.db.com
> > >
> > >
> > >
> > >
> > > "David CastaƱeda" <[EMAIL PROTECTED]>
> > > 06/03/2008 14:58
> > > Please respond to
> > > [email protected]
> > >
> > >
> > > To
> > > [email protected]
> > > cc
> > >
> > > Subject
> > > Re: CXF logging
> > >
> > >
> > >
> > >
> > >
> > >
> > > that's what I do, because I use Log4J ... to the JVM, pass this
> > > parameter. and configure log4j
> > >
> > > -Dorg.apache.cxf.Logger=org.apache.cxf.common.logging.Log4jLogger
> > >
> > >
> > > But what you really need is an interceptor, see the docs and
> > > samples and search for LogInInterceptor and LogOutInterceptor.
> > >
> > > On Thu, Mar 6, 2008 at 9:50 AM, John-M Baker <[EMAIL PROTECTED]>
> >
> > wrote:
> > > > Hi,
> > > >
> > > > What's the best way to turn on debug logging? I'd like to see
> > > > what XML
> > >
> > > is
> > >
> > > > being sent from the client and I'm sure that'll be in the debug
> > > > (well,
> > >
> > > I
> > >
> > > > hope it is!). I tried a simple log4j.xml file but that iddn't
> > > > seem to work.
> > > >
> > > > Thanks,
> > > >
> > > >
> > > > John Baker
> > > > --
> > > > Web SSO
> > > > IT Infrastructure
> > > > Deutsche Bank London
> > > >
> > > > URL: http://websso.cto.gt.intranet.db.com
> > > >
> > > >
> > > > ---
> > > >
> > > > This e-mail may contain confidential and/or privileged
> > > > information. If
> > >
> > > you are not the intended recipient (or have received this e-mail
> > > in error) please notify the sender immediately and delete this
> > > e-mail. Any unauthorized copying, disclosure or distribution of
> > > the material in this e-mail is strictly forbidden.
> > >
> > > > Please refer to http://www.db.com/en/content/eu_disclosures.htm
> > > > for
> > >
> > > additional EU corporate and regulatory disclosures.
--
J. Daniel Kulp
Principal Engineer, IONA
[EMAIL PROTECTED]
http://www.dankulp.com/blog