logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Duerr <due...@gmail.com>
Subject Individual logging output of multiple objects to multiple files
Date Thu, 08 May 2008 12:12:46 GMT

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

View raw message