Add log4cxx support, improve error messages.