Custom log exception handler