Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to control log level of synthetic events from .with_span_events()?

I'm able to emit events using .with_span_events(), but they are created at TRACE level. Is there any way to cause these to be created at a different level?

like image 533
ajp Avatar asked Nov 17 '25 14:11

ajp


1 Answers

The level is determined by the span's itself level, and this is hardcoded and cannot be changed.

The level of the span can be set:

  • If you are using the span!() macro, the first argument is the level. Or you can use one of the shortcut macros: trace_span!() etc..

  • If you are using #[instrument], you can pass a level = "<level>" argument to it.

like image 174
Chayim Friedman Avatar answered Nov 20 '25 06:11

Chayim Friedman