Remove hard dependency on log4j

See ticket #9606.