moved logger before checking environments in halt()