Structured logs
So-called "structured logs" are simply logs where each line is a JSON document.
This is the de-facto standard followed by many projects, notably most GitLab components (some also have legacy logs, which are deprecated). Providing structured logs would presumably allow to leverage the same log mining tools as GitLab generally supports.
It is not clear whether we should systematically switch to structured logs, using the logging
Python module or simply use them in the general requests logger.
In any case, the recent logging of correlation_id has shown the limits of the current approach, with logging
format strings making all their keys required (even replacing correlation_id
with an empty string when not available would not be very satisfying), whereas a JSON logger would probably be more flexible.