You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by ti...@prescreen.co.uk on 2004/03/12 14:30:37 UTC

[Pool] Logging what's going on...

Hi,

Are there any plans to put any logging in the Pool implementations?

I'm using the GenericObjectPool with the DBCP and I have a thread 
querying the getNumActive() method.  I'm seeing it fluctuate between two 

different values (when my application is idle).  Its probably because 
I've got my evictions set-up wrongly.  Anyway that's not my issue here.

Logging would be a wonderful addition when debugging configuration 
issues (like mine), object exhaustion problems and being able to see 
what's actually 
happening when in use.  Are there any plans?

I'll help if you think this will be a useful addition.


Tim


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


RE: [Pool] Logging what's going on...

Posted by "Noel J. Bergman" <no...@devtech.com>.
> A short term solution is of course to subclass and simply add some
> logging datatment to the borrow/return methods.

In Avalon, we're also talking about adapting Commons classes for use with
Avalon.  I'm not sure if subclassing is always going to put the log where
needed, but that is certainly one pattern that would go a long way.

So I think your proposal amounts to a pattern like:

   class AvalonComponent extends CommonsComponent
                         implements AvalonInterfaces

   {
       AvalonMethod(...) { ... };
       LoggedMethod(...) { ... super.LoggedMethod(...); ... }
   }

An alternative would be to use delegation, so that the AvalonComponent had
an instance of the CommonsComponent, but didn't expose the
CommonsComponent's interface.  Logging might still require subclassing,
though, in some cases.

That about sum it up?

	--- Noel


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


Re: [Pool] Logging what's going on...

Posted by Dirk Verbeeck <di...@pandora.be>.
The idea was to let the pool fire pool events and then a listener 
could log or otherwise react on changes in the pool size.
The implementation was stopped because commons-collection was 
implemention an event framework (currently in the sandbox)
http://jakarta.apache.org/commons/sandbox/events/

But maybe it is easier to build the pool event system from scratch.
It would be a welcome addition.

A short term solution is of course to subclass and simply add some 
logging datatment to the borrow/return methods.

-- Dirk


tim.redding@prescreen.co.uk wrote:

> Hi,
> 
> Are there any plans to put any logging in the Pool implementations?
> 
> I'm using the GenericObjectPool with the DBCP and I have a thread 
> querying the getNumActive() method.  I'm seeing it fluctuate between two 
> 
> different values (when my application is idle).  Its probably because 
> I've got my evictions set-up wrongly.  Anyway that's not my issue here.
> 
> Logging would be a wonderful addition when debugging configuration 
> issues (like mine), object exhaustion problems and being able to see 
> what's actually 
> happening when in use.  Are there any plans?
> 
> I'll help if you think this will be a useful addition.
> 
> 
> Tim




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