Moving logfile close in shutdown method