Added logDirectory argument