Sets up log4j properly.