commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott Sanders" <ssand...@nextance.com>
Subject RE: how should log levels work? [Was Re: [Logging] default log level]
Date Wed, 09 Jan 2002 20:26:36 GMT
> -----Original Message-----
> From: Paulo Gaspar [mailto:paulo.gaspar@krankikom.de] 
> Sent: Wednesday, January 09, 2002 12:41 PM
> To: Jakarta Commons Developers List
> Subject: RE: how should log levels work? [Was Re: [Logging] 
> default log level]
> 
> 
> > I can see your viewpoint, but I think that it is sometimes 
> necessary. 
> > What if my component logs to 25 categories but I give you 
> an easy way 
> > to cascade it by calling the main setLevel().
> 
> Such complex component MUST have some configuration mechanism for the 
> logger.

Possibly, but it you plug that component into your framework which uses
LogKit, wouldn't you just want LogKit to take over and handle it.  In
that case you do NOT need setLevel.  I was refering to the case when you
do NOT have Log4J or LogKit or JDK1.4.  But as Craig once said, this is
a VERY slippery slope.

> 
> The logger may have too. With Log4J there is a XML 
> configuration file and with Avalon's LogKit there is a 
> similar mechanism that is still hiding in another part of the API.

Yes.

> 
> 
> But I also wrote:
> > >    Notice that I believe in being able to set the level in some
> > >    common configuration mechanism, just not on the interface.
> 
> Which means that there should be a (maybe optional) logging 
> mechanism that helps you configure that kind of thing. But 
> after that, you just use a Logger with no setLevel().
> 
> 
> Anyway, if by the People demand the setLevel() must exist, then I 
> still think it should always work, whatever was the original 
> level. Otherwise it even looks broken!

I am not demanding that it exist.  From a purist, 'I want the smallest
wrapper possible perspective', I would not support it.  But I do think
it has a use.

Scott

> 
> 
> Have fun,
> Paulo Gaspar
> 
> 
> > -----Original Message-----
> > From: Scott Sanders [mailto:ssanders@nextance.com]
> > Sent: Wednesday, January 09, 2002 8:23 PM
> > 
> > 
> > I can see your viewpoint, but I think that it is sometimes 
> necessary. 
> > What if my component logs to 25 categories but I give you 
> an easy way 
> > to cascade it by calling the main setLevel().
> > 
> > Scott
> > 
> > > -----Original Message-----
> > > From: Paulo Gaspar [mailto:paulo.gaspar@krankikom.de]
> > > Sent: Wednesday, January 09, 2002 11:39 AM
> > > 
> > > 
> > > I personally think you should avoid changing the log level
> > > after the configuration step.
> > > 
> > > However, I also agree that if you call setLevel() is because
> > > you really want to change the level and are supposed to know 
> > > what you are doing.
> > > 
> > > The 2 alternatives that make more sense to me:
> > >  - A setLevel() that always changes the level;
> > > 
> > >  - No setLevel() at all.
> > >    The (Avalon) wrappers I use work this way and I never miss that
> > >    thing. I am not sure if it is such a common need that it should
> > >    have a place in this common interface.
> > > 
> > >    Notice that I believe in being able to set the level in some
> > >    common configuration mechanism, just not on the interface.
> > > 
> > > 
> > > Have fun,
> > > Paulo Gaspar
> > > 
> > > 
> > > > -----Original Message-----
> > > > From: Scott Sanders [mailto:ssanders@nextance.com]
> > > > Sent: Wednesday, January 09, 2002 7:28 PM
> > > >
> > > >
> > > > I think that all calls should push through to the
> > > underlying system,
> > > > and that if possible the set/getLevel methods should operate on 
> > > > the
> > > > underlying implementation.
> > > >
> > > > Scott
> > > > ...
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:commons-dev-> unsubscribe@jakarta.apache.org>
> For 
> additional commands, 
> e-mail: <mailto:commons-dev-help@jakarta.apache.org>
> 
> 

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message