You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by zhvfeng <zh...@hotmail.com> on 2005/08/17 03:33:58 UTC

How to remove the logger instance?

Hi,

    My app need to dynamically create many loggers, is there any way to remove the logger instance at runtime? Otherwise, I'm afraid, the memory will be increased continuously.

Regards

Re: How to remove the logger instance?

Posted by Curt Arnold <ca...@apache.org>.
On Aug 16, 2005, at 8:33 PM, zhvfeng wrote:

> Hi,
>
>     My app need to dynamically create many loggers,

Why?

Calls to getLogger() will return a previously created instance if the  
arguments are identical, so the concern is the number of distinct  
logger names requested.  Logger names are primarily an organizational  
technique to allow you to control destinations, thresholds and such.   
Having a large number of logger names reduces the organizational  
benefit of each distinct name.  It is as if you decided that each  
file needed to be in its own directory, then the benefit of each new  
directory as an organizational technique becomes less and less.

> is there any way to remove the logger instance at runtime?

Not readily if at all.

> Otherwise, I'm afraid, the memory will be increased continuously.

In an intentionally degenerate case, it could be an issue, but in a  
normal logging hierarchy, it shouldn't be an issue.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org