You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using tracing with tracing-log to convert log crate entries to tracing events I'd like to exclude such events from being exported to my tracing backend. For filtering one can for instance utilize Metadata but I can't find any option to tell whether an event was sourced from a log entry. So I currently must export all my logs to the tracing backend which is what I want to prevent.
Proposal
Somehow mark tracing events sourced from log so it can be filtered later on
Alternatives
I found tracing quite useful as primary logger due to it's layer system. Maybe I am using the wrong tools here and should rather take a regular logger and then convert tracing events to logs?
The text was updated successfully, but these errors were encountered:
tracing_subscriber::registry().with(tracing_subscriber::fmt::layer()).with(filter_fn(|meta| {
meta.fields().field("log.target").is_none()})).init();
log::debug!("this is a log line");
tracing::debug!("this is a tracing line");
log-events do have some metadata that distinguish them: log.target, log.module_path, log.file, log.line. But this is not really a fool-proof solution. Maybe we could add a specific field like: source: log or something?
Feature Request
Crates
Motivation
When using
tracing
withtracing-log
to convertlog
crate entries to tracing events I'd like to exclude such events from being exported to my tracing backend. For filtering one can for instance utilize Metadata but I can't find any option to tell whether an event was sourced from alog
entry. So I currently must export all my logs to the tracing backend which is what I want to prevent.Proposal
log
so it can be filtered later onAlternatives
I found
tracing
quite useful as primary logger due to it's layer system. Maybe I am using the wrong tools here and should rather take a regular logger and then convert tracing events to logs?The text was updated successfully, but these errors were encountered: