Exception logging improved