Skip to content

How to remove span name in log message? #2424

Answered by elkowar
notinmybackyaard asked this question in Q&A

You must be logged in to vote

You can use a filter on your fmt-layer, for example a filter_fn which filters out span events for that layer.

I.e.:

tracing_subscriber::registry()
    .with(format_layer.with_filter(filter::filter_fn(move |meta| {
        !meta.is_span() || include_span_info
    })))
    .with(env_filter)
    .init();

Replies: 1 comment

You must be logged in to vote
0 replies
Answer selected by notinmybackyaard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants