You should avoid dumping the raw error entirely. The idea is that error_slug is a stable grouping key.
The idea is to consolidate all that can be grouped into one logical unit. So you would do one long log line at the end, after all tasks are done.