Andy - assuming you mean getting rid of all globals in favor of function local static objects - how does that help? Static object destructors are run in reverse order of construction. So won't this bug surface anytime you have a construction order where activemqcpp objects get initialized after the logging objects? And won't that be provokable by importing lsst.log, doing some stuff to force log4cxx objects to get created, and then importing ctrl_events and executing the python code above?
Outside of changing the way activemqcpp uses static objects, or moving the EventAppender from ctrl_events over to log, maybe you could force the log package to link against activemqcpp when it is available, or explicitly try loading activemqcpp at runtime before creating the log4cxx root logger?
Also, I'm not sure if it is important, but ctrl_events seems to be missing a call to activemq::library::ActiveMQCPP::shutdownLibrary(), which seems to be present in the examples for that library. Then again, I don't know if it's safe to call outside of main, or how ctrl_events could arrange to call it at the right time.