Fix logging during shutdown procedure

Refs #5788