Adding logging support to error handler