rust-tracing Questions
3
Solved
I need to instrument spans with different names dynamically. How can I create a tracing span with dynamic naming?
use tracing; // 0.1.22
fn main() {
let name: &'static str = "foo bar&quo...
Handout asked 15/1, 2021 at 11:52
2
Solved
I use tracing, and I only want to see my own debug events. However, some crates I depend on also have tracing support, and they litter the event stream. So when I increase verbosity to DEBUG, I see...
Aforementioned asked 5/8, 2022 at 9:31
3
Solved
My application is using the tracing Rust crate to create log output. How do I print these log messages when I'm running my tests?
Sachs asked 6/7, 2022 at 13:51
1
Solved
I'm learning Axum and I will like to add logging to the service I have put together but unfortunately I cannot get it to work.
I have added tower-http to use the TraceLayer and added it to my app:
...
Martins asked 4/1, 2023 at 17:44
2
Solved
When I write logs to a file with tracing-appender, I get output with terminal color artifacts which do not render when viewing them as a text file:
[2mOct 02 23:44:57.484[0m [34mDEBUG[0m
Is there ...
Sunshine asked 3/10, 2021 at 11:7
1
I want to capture the duration of execution of a span in the Rust tracing crate and send that as metric. I have found that fmt() helps in printing that as mentioned here: How can I log span duratio...
Ralph asked 7/12, 2022 at 1:5
1
Solved
I am using Axum for a relatively simple Web API and would like to get a logging/tracing output for incoming requests similar to Go Gin, IIS logs, Python FastAPI, etc. - a simple path and parameters...
Debility asked 3/11, 2022 at 11:9
1
Solved
Let's say I have a function that returns a Vec<Box<dyn Subscriber>> and I want to combine them into a single one to be set as the default subscriber.
How to do this?
I'm trying to do so...
Laggard asked 1/2, 2021 at 14:51
2
Solved
As a developer I would like to adjust the log level on the fly. For example, I don't want to log debug! events when everything is going fine, but when something happens, I would like to adjust the ...
Viafore asked 8/5, 2022 at 8:42
2
Solved
I have a very simple code example here which just wants to get the first item of a list I pass in. I have been trying to instrument the code with tracing to help debug the application but frankly t...
Hawthorne asked 18/11, 2021 at 0:28
1
Solved
Rust has a tracing library that seems quite popular. It uses a building block called "span":
Spans represent periods of time in the execution of a program.
Now that I've set spans all t...
Torietorii asked 14/9, 2022 at 14:4
1
Solved
How to print what source line! and file! a trace log originated from with tracing and tracing-subscriber?
The code I'm working with is well prepared and contains lots of log prints, which is good, ...
Papoose asked 12/7, 2022 at 5:53
0
When using warp with tracing enabled, I find the tracing output to be noisy. This is because a set of tracing events is emitted by every route, i.e., filter, that is attempted on each request.
So f...
Illegalize asked 5/8, 2021 at 0:23
1
I'm using the tracing library in my project and there is one thing I'm not able to figure out: How can I access a value (that I set in my span when I create it) in my Layer?
My layer looks like thi...
Richards asked 11/3, 2021 at 2:35
1
Solved
I'm try to implement some centralized logging with the tracing crate. I can write to a rolling file with the tracing-appender crate or to a Graylog application with the following code:
let mut guar...
Paresthesia asked 10/2, 2021 at 13:45
0
I'm writing a Rust crate for internal company use that wraps the excellent Tokio tracing crate, with a bit of additional functionality. Not only do I re-export the macros in tracing, but I also add...
Tawnytawnya asked 19/2, 2020 at 16:45
1
© 2022 - 2025 — McMap. All rights reserved.