Refactor log configuration to allow user configure logging properties.
Fix shutdown error