Added sanitization to $logdate

$logdate was not being escaped properly, which resulted in errors if the user used apostrophes (') in their date format setting.