Add a feature to avoid logging too many times the same error

## Context
Sometimes, the same error was logged more than 8000 times in production and completely filled the log files.

## Description
Add a feature to avoid logging too many times the same error in a session (the default behaviour is to report all errors).