Fix crash of logger if called from a 500 catch