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
For the moment only metadata available in the MakeWriter is event's metadata, which is very limited. A basic use-case of creating different writers for each span with certain value specified is impossible.
I don't think my use-case is very niche. I have a tonic service that creates workers, each with unique id. I want to store a log for each bot separate.
The most logical solution for that came to mind is to create a worker-wide span with its id in the span and open/drop (a handle) based on span's lifetime. Create/open a file and write to it.
Now this is a motivation part. There is no API to either get access to span's data at all.
Proposal
Add on_span_enter, on_exit and Context<'_, S> to the MakeWriter trait.
Alternatives
Can't find one, FmtContext's constructor being behind private does not let me format my own fields in the record.
Feature Request
Crates
tracing-subcriber
Motivation
For the moment only metadata available in the
MakeWriter
is event's metadata, which is very limited. A basic use-case of creating different writers for eachspan
with certain value specified is impossible.I don't think my use-case is very niche. I have a
tonic
service that creates workers, each with unique id. I want to store a log for each bot separate.The most logical solution for that came to mind is to create a worker-wide span with its id in the span and open/drop (a handle) based on span's lifetime. Create/open a file and write to it.
Now this is a motivation part. There is no API to either get access to span's data at all.
Proposal
Add
on_span_enter
,on_exit
andContext<'_, S>
to theMakeWriter
trait.Alternatives
Can't find one,
FmtContext
's constructor being behind private does not let me format my own fields in the record.Comments
This is my code that's trying to circumvent this: https://gist.github.com/feelingnothing/2db9cc4734aece2d3fdaa2601d53b8a8
The text was updated successfully, but these errors were encountered: