logfmt
logfmt copied to clipboard
feat: replace invisible control characters in keys with "_"
Control chars in keys are currently completely removed.
That causes that foo\x12bar appears equally to foobar in the logline.
A log reader (developer) also doesn't recognize that something "wrong" or "broken" or "dangerous" has been tried to log.
Therefor I would propose to replace these control chars with _ (or the unicode equivalent escape sequence, but that looks dirty).
The case when this happens in real world is probably under 0.9%.
Python-logfmter would like to have a equal behavior than this project: https://github.com/josheppinette/python-logfmter/issues/54