Thanks Boris,
that if was looking for,
David
Boris Unckel <[EMAIL PROTECTED]> wrote:
Hello,
by mistake I responded directly to Simon and not the list.
Here my remark and his answer.
Regards
Boris
Von: Simon Kitching
On Thu, 2006-04-06 at 12:05 +0200, Boris Unckel wrote:
> Hello,
> > Von: Simon Kitching
> > On Thu, 2006-04-06 at 02:47 -0700, David wrote:
> > > Dear members,
> > >
> > > I would like to use java.util.logging and configure it
> > > programatically, on the common-logging documentation there is
> > > information about how to do
> > > it with the properties files, but I don't see the way for doing
> > > directly on the source code.
> > >
> > > I have a simple class that have setLogger/getLogger, I just wanto to
> > > test in a tester class how should work for using java.util.loggins or
> > >the Simple log from commons.
> > commons-logging does not provide *any* mechanism for configuring the
> > "real" underlying logging library (except for the special case of the
> There is a small misunderstanding:
> As I understand, he wants to know how to configure commons-logging not by
> property but by code. He is not interested in a "configure-the-underlying"
> method.
Ah, you might be right..
> As I currently know, there is no method available to choose the
> underlying-API from user code. You would have to provide your own
> implementation of the discovery and factory mechanism.
There *is* such a mechanism. This call:
LogFactory.getFactory().setAttribute(
"org.apache.commons.logging.Log",
"org.apache.commons.logging.impl.JDK14Log");
will force the use of java.util.logging.
Of course it needs to be called before any Log instances are created...
Cheers,
Simon
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------
New Yahoo! Messenger with Voice. Call regular phones from your PC and save big.