[Prev] Thread [Next]  |  [Prev] Date [Next]

RE: Memory leak due to LogImpl? Daniel Marohn Wed Apr 29 04:00:36 2009


> There is no matching -= for logger.Repository.ConfigurationChanged

There shouldnt be one, becourse once created the instance of the
logger will be stored by the repository until aplication ends. I you
use the same loggername you will get the same instance. I guess your
problem is that you do not use the logmanager or repositorie's
GetLogger member but create your instances by yourself (wich will
result in multiple instances of logger with the same name).

You need to implement the ILoggerFactory interface to create your
custom, subclassed logger. Then you configure the Hierarchy to use
your factory.
= new CustomFactory();

Now you can use the LogManager or the Repository to create loggers and
only one instance per name will be created.

hve phn!