How Tracy's Logger handles exceptions and deduplication
masterThe Logger::log() method appends text lines to <level>.log files. When a Throwable is logged, Tracy generates an HTML BlueScreen report and a .md companion file.
To prevent log flooding, Tracy uses hash-based deduplication:
- It generates a hash of the exception chain (class, message, code, file, line, and trace without arguments) using
xxh128, truncated to 10 characters. - Because arguments are stripped from the trace, identical exceptions thrown with different argument values produce the same hash.
- If a report with that hash already exists, Tracy will not overwrite it; it will only append a new line to the
<level>.logfile. This ensures that recurring errors do not repeatedly generate heavy HTML reports.