Hi there,
I am developing a shared library using c++ under Linux. I would like to user log4cxx for logging purposes. However, I'm not sure how to initialize this. For log4cxx I need to create a logger object. How can I make sure this object is created when my library is loaded?
I suspect that it will be easiest to create the logger object as a global variable and then use it from any of the source files of my library, declaring it as extern in the headers. But how can I have the logger created automatically once an application connects to the library?
I know that in DLLs for Windows, there's a thing as REASON_FOR_CALL == PROCESS_ATTACH; is there a similar thing under Linux?