rewrite the configure function and add Log4js function