On Wed, 3 Apr 2002, Craig R. McClanahan wrote:
> > public interface LogUser
> > {
> > public void setCommonsLogger(Log log)
> > }
> >
>
> I can see why some people might like to have a log setter method like this
> (rather than letting the log-using component define its own log name).
> What I don't see (yet?) is the value of having this interface defined in
> commons-logging itself. Isn't the decision to need/use this made on a
> component by component basis anyway? Don't the cooperating components
> have to know about it in order to call this method, whether its an
> o.a.c.l.LogUser interface or just a public property setter?
I think the value here is to establish a pattern ( i.e. a method name )
that can be used consistently in all components that decide to make the
log configurable.
With JMX you'll not have to implement the interface, but if the pattern is
used you'll know that all components can be managed in a consistent way.
( of course, setting the logger name would be easier to use in some cases)
It'll also reduce the coupling between components and frameworks - with it
the component will depend only on commons-logging, and not on a
framework-defined interface.
Costin
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>