Skip to content

Add logfiles, and per-target log filters.

Nick Mathewson requested to merge nickm/arti:logfiles into main

Previously we could only configure one global tracing filter that applied to stdout and journald (#170 (closed)). There was no support for log files, either (#166 (closed)).

This patch fixes both issues, by substantially revising the configuration format: There are now separate filters for each log file, for journald, and for the console log. Because we want to allow multiple logfiles, they have to go into an array in the configuration.

The configuration logic has grown a bit complicated in its types, since the tracing_subscriber crate would prefer to have the complete structure of tracing Layers known statically. That's fine when you know how many you have, and which kinds there will be, but for the runtime-configuration case we need to mess around with Box<dyn Layer ...>.

I also had to switch from tracing_subscriber's EnvFilter to its Targets filter. It seems "EnvFilter" can only be applied as a Layer in itself, and won't work as a Filter on an individual Layer.

Closes #166 (closed).

Closes #170 (closed).

Merge request reports

Loading