Fix NPE in log4j appender.