From: <log...@li...> - 2015-02-14 08:40:32
|
Hello Sorin, When you say log4cplus, I suppose you mean log4cpp actually, don't you? The best thing I may suggest you is that your plugins do not initialize loggers (or even other resources) themselves, but instead provide API calls for the user of your plugin library. This way you avoid checks for sanity and have better control for your resources. Several loggers coexist fine as soon as they have different names. If you ask about ones having same names, you are putting loaded gun into your pocket. You could do tricks do determine the fact, but it is out of usage patterns for the library, and I would not advise you to do it. The common approach for logging is having single log4.properties file per process no matter how many libraries does it involve. Regards, Alexander. On Feb 11, 2015 6:45 PM, <log...@li...> wrote: > Hello, > > I'm wondering if several logger instances may co-exist in the same > process. Each logger instance is initialized from a different properties > file. > > The use case is when I develop a plugin (a DSO in unix) that is loaded > with dlopen in the process. I cannot know if another plugin uses > log4cplus. Therefore both my plugin and a third party's plugin may > invoke PropertyConfigurator::doConfigure(property_file) each with its > own property_file. What would happen then? > > Is there a way to determine if the third party's module has already > initialized the logging system and executed doConfigure(property_file)? > > Thank you, > Sorin > > > > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming. The Go Parallel Website, > sponsored by Intel and developed in partnership with Slashdot Media, is > your > hub for all things parallel software development, from weekly thought > leadership blogs to news, videos, case studies, tutorials and more. Take a > look and join the conversation now. http://goparallel.sourceforge.net/ > _______________________________________________ > Log4cpp-devel mailing list > Log...@li... > https://lists.sourceforge.net/lists/listinfo/log4cpp-devel > |