Make the error logging support the EnableLogAsJson option