Hallo,

I'm writing a simulation application, that creates and destroys several objects
of the same class during the simulation. I want to perform logging for each of
these objects to a single file (i.e. I want only the output of one object in the
corresponding object's logging file). The application is single threaded.

Can I achieve this behaviour with log4cxx - if so - how? I tried to implement
this behaviour by initializing a new logger for each new object. But since there
are up to 10000 objects this seems to be inefficient. Furthermore I could not
figure out how to delete such a logger in case the associated object gets
destroyed (how todo this???) and hence I experienced a lot of memory leaks. To
my best knowledge MDC is also no alternative, since it does not allow for the
restricted object->file logging.

Is there any chance to achieve this logging behaviour with log4cxx?

Thank you!

Cheers Michael

Reply via email to