Skip to content

Adjust log level based on http request parameter #3005

Answered by mladedav
dominikwerder asked this question in Q&A
Discussion options

You must be logged in to vote

I don't think you can do this with a single EnvFilter. What I think should work though is using two filters, the first one the same as you're currently using and another one with info,my_crate=trace.

This should make it so both filters are queried and if both enable the the event, only then is it emitted.

The main problem here is that you cannot set both the filters with a single env variable (or you have to parse it yourself).

I am not entirely sure though because the dynamic span filters are a bit magic so please do challenge this if it doesn't work for you.

Ideally, we would probably want to support this in a single filter, but there is no syntax for this right as far as I know.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@dominikwerder
Comment options

@mladedav
Comment options

@dominikwerder
Comment options

Answer selected by dominikwerder
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