Initialize log4cplus early if possible.

Use GCC constructor function attribute when it is present.