add application scopes and fix logging for production debug