tweaked debug messages and logger shutdown