Improve error logging output