add log4j.xml and unit test and fix one bug