Add error codes to log output