The logDir is a copy from CE (Seann's work) + small improvement checking the trailing '/'