set logger before registrate to an error handler
Merge pull request #8948 from owncloud/fix-logger-race-condition

set logger before registrate to an error handler