Parameter debDir added
cleanup logging