LukeMathWalker/tracing-actix-web

span.file is always `root_span_builder.rs`

davidB opened this issue · 3 comments

Hi Luca,

Thanks for the lib and your book.
When a span is created target, line and file are recorded, cool for debug, (maybe less for security). But the value are always the same, the place where the span was created aka inside tracing-actix-web:

{
  ...
  "time": "2021-05-21T17:02:54.521146+00:00",
  "target": "tracing_actix_web::root_span_builder",
  "line": 39,
  "file": "/Users/david.bernard/.cargo/registry/src/github.com-1ecc6299db9ec823/tracing-actix-web-0.4.0-beta.4/src/root_span_builder.rs",
  ...
}

Is it possible to remove this information or to display the caller of the lib ?

Hey!

This is working as intended (and the field comes from your tracing sink, not from tracing-actix-web) - it should show where the log line is defined, which is indeed in the middleware.

Hi,

So the value for those field will be always the same, a point in the source of tracing_actix_web, instead of a point inside the app source, eg where 'tracing::info!(...);' is called ?

OK, my mistake, Sorry,
The bunch of log I got/analyzed only include trace form the middleware (aka the begin + end of span for http request), and nothing from the app.

Thanks