Fixed logging issue

Control debug mode via config file to ensure logging is only initialized when debug mode is disabled.