Alan's suggestion of putting the user-defined operator in the std
namespace works. But I prefer putting the user-defined operator in the log4cxx::helpers
namespace, which also works. Specifically,
namespace log4cxx { namespace helpers {
ostream& operator<<(ostream& os, const A& a);
} }