Added mkdirp for log directory.