3 ms·
How generally are people dealing with these coloured logs when ingesting them into a centralized logging system? Is there much overhead in stripping these sort
by scandox 5y ago
How generally are people dealing with these coloured logs when ingesting them into a centralized logging system? Is there much overhead in stripping these sort of things out.
- jagger27 5y agoMost of the time they’re not printed out at all because of isatty in underlying libraries. Centralized logging doesn’t usually go through a TTY.
- noitpmeder 5y agoThis is the correct answer (or at least it should be). Only print colors when going to a TTY, not when writing logs to a file.
- sverhagen 5y agoI think that in some cases you end up capturing the control codes that control these colors, so then you want to disable the colored output explicitly.
- hedora 5y agoI think state of the art is to add a json output mode, then berate people that complain that neither option is ergonomic if you actually need to read production logs.
- cyral 5y agoI reported this issue four years ago to Google Cloud (not sure if it was ever fixed, no updates to the report), as they don't stripe out ANSI color codes nor render them, so our logs in their log viewer were full of gibberish from any colored messages.