shuttle-hq / shuttle

Build & ship backends without writing any infrastructure files.
https://shuttle.rs
Apache License 2.0
5.94k stars 245 forks source link

[Bug]: Logging still happens even with shuttle_runtime --no-default-features flag #1586

Open joshua-mo-143 opened 7 months ago

joshua-mo-143 commented 7 months ago

What happened?

Installing shuttle_runtime with no default features still causes logging to happen. Adding a custom subscriber with timestamps causes double timestamping.

Discord conversation reference: https://discord.com/channels/803236282088161321/953005742842069013/1200211085253427280

Version

v0.37.0

Which operating system(s) are you seeing the problem on?

Linux

Which CPU architectures are you seeing the problem on?

x86_64

Relevant log output

(see the referenced discord conversation)

Duplicate declaration

oddgrd commented 7 months ago

That logs are recorded without the default tracing subscriber is expected, we capture any logs written to stdout by an application, and this is documented. We could add a note about the timestamps as explained by Johan in the linked thread, however, and perhaps update the example custom subscriber to not record timestamps.

It's also the case that if you don't write to stdout and rather export to e.g. Datadog, the logs sent to Datadog will not have extra timestamps.

oddgrd commented 7 months ago

We could also consider making it possible to opt-out of the timestamps set by us, but that would require some further investigation.