commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject Re: [logging] Need interface...
Date Wed, 03 Apr 2002 15:55:01 GMT
On Wed, 3 Apr 2002, Geir Magnusson Jr. wrote:

> What we need is a marker interface that indicates a tool wants a logger, and
> of course a method to give it the logger...  I did a quick scan of the
> public API, and there doesn't seem to be one.
> So what I propose is to add an interface 'LogUser' or something like it (we
> can quibble about the name...)
>  public interface LogUser
>  {
>     public void setCommonsLogger(Log log)
>  }

In other words, you also want a 'push' model for the logger. Curently each 
component is supposed to 'pull' the logger.

Well, I can't say no. I prefer the current Log.getLog() pattern, but
the whole point of commons is to be open and accept multiple points
of view, instead of forcing everyone to use a 'right' thing.

+1 on the idea - but maybe we can discuss a bit the details. LogUser 
and setCommonLogger sounds a bit weird, and I'm not sure I understand who
will call the method.

In JMX terms, you would have a method setLogger( o.a.commons.logger.Log )
or setLoggerName( String ) and based on some config JMX will set the 
logger. The Log???? interface will be extended by the component 
MBean interface ( if any ). Seems a valid use case, and a good idea to 
'standardise' the pattern used to set the logger in a component. 

Maybe even a set logLevel() to tune the ammount of output the component 
generates - i.e. a second filter pattern. I wouldn't say no, since the 
pattern is in wide use in tomcat(3 at least, and other projects as well ) 
and quite usefull.

> As I personally believe that just being a commons committer doesn't give me
> the 'spirit-of-the-law' right to commit to the logger, I'll ask for some
> even vague hint of approval from the logger people before moving forward.

Good idea, given the amount of debate we had for each API change in 
commons-logger. I would do the same.

However feel free to commit anything in the impl :-). 


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message