From 2fdbf0952e3c447d28f2ce144c38d33b58eb316f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Ml=C3=A1dek?= Date: Wed, 30 Oct 2024 15:05:25 +0100 Subject: [PATCH] Add `json-subscriber` to ecosystem (#3121) ## Motivation I've created a library for better customization of JSON log lines and would like to make it more discoverable. This subscriber could help with a lot of issues such as #1531 ## Solution Add `json-subscriber` to the ecosystem. --- tracing/README.md | 2 ++ tracing/src/lib.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tracing/README.md b/tracing/README.md index 73f5e75f0..c94185ad2 100644 --- a/tracing/README.md +++ b/tracing/README.md @@ -379,6 +379,7 @@ maintained by the `tokio` project. These include: - [`sentry-tracing`] provides a layer for reporting events and traces to [Sentry]. - [`tracing-loki`] provides a layer for shipping logs to [Grafana Loki]. - [`tracing-logfmt`] provides a layer that formats events and spans into the logfmt format. +- [`json-subscriber`] provides a layer for emitting JSON logs. The output can be customized much more than with [`FmtSubscriber`]'s JSON output. If you're the maintainer of a `tracing` ecosystem crate not listed above, please let us know! We'd love to add your project to the list! @@ -410,6 +411,7 @@ please let us know! We'd love to add your project to the list! [`tracing-loki`]: https://crates.io/crates/tracing-loki [Grafana Loki]: https://grafana.com/oss/loki/ [`tracing-logfmt`]: https://crates.io/crates/tracing-logfmt +[`json-subscriber`]: https://crates.io/crates/json-subscriber **Note:** that some of the ecosystem crates are currently unreleased and undergoing active development. They may be less stable than `tracing` and diff --git a/tracing/src/lib.rs b/tracing/src/lib.rs index 3e88cf9f2..0b403f3b2 100644 --- a/tracing/src/lib.rs +++ b/tracing/src/lib.rs @@ -817,6 +817,7 @@ //! - [`reqwest-tracing`] provides a middleware to trace [`reqwest`] HTTP requests. //! - [`tracing-cloudwatch`] provides a layer that sends events to AWS CloudWatch Logs. //! - [`clippy-tracing`] provides a tool to add, remove and check for `tracing::instrument`. +//! - [`json-subscriber`] provides a subscriber for emitting JSON logs. The output can be customized much more than with [`tracing-subscriber`]'s JSON output. //! //! If you're the maintainer of a `tracing` ecosystem crate not listed above, //! please let us know! We'd love to add your project to the list! @@ -860,6 +861,7 @@ //! [`reqwest`]: https://crates.io/crates/reqwest //! [`tracing-cloudwatch`]: https://crates.io/crates/tracing-cloudwatch //! [`clippy-tracing`]: https://crates.io/crates/clippy-tracing +//! [`json-subscriber`]: https://crates.io/crates/json-subscriber //! //!
//!