Create logs directory before writing logs.