Replace env_logger with tracing#2381
Merged
generall merged 6 commits intotracing-improvementsfrom Aug 15, 2023
Merged
Conversation
TODO: - Implement slog drain that would *properly* convert slog records into tracing events (`slog-stdlog` is fine for now, though)
…ing-log` Fix `consensus` test
…`/`tracing-log` Forget to `unwrap` the result 🙈
…`/`tracing-log` `tracing_subscriber::fmt::init` initializes `tracing_log::LogTracer` automatically with default `tracing-subscriber` features enabled 💁♀️
10 tasks
timvisee
approved these changes
Aug 8, 2023
Contributor
Author
Some crates are using |
Member
Yeah, that seems more reasonable. Maybe we can set that as default here. What do you think? |
generall
approved these changes
Aug 15, 2023
generall
approved these changes
Aug 15, 2023
generall
pushed a commit
that referenced
this pull request
Aug 15, 2023
* Replace `env_logger` with `tracing`/`tracing-subscriber`/`tracing-log` TODO: - Implement slog drain that would *properly* convert slog records into tracing events (`slog-stdlog` is fine for now, though) * fixup! Replace `env_logger` with `tracing`/`tracing-subscriber`/`tracing-log` Fix `consensus` test * fixup! fixup! Replace `env_logger` with `tracing`/`tracing-subscriber`/`tracing-log` Forget to `unwrap` the result 🙈 * fixup! fixup! Replace `env_logger` with `tracing`/`tracing-subscriber`/`tracing-log` `tracing_subscriber::fmt::init` initializes `tracing_log::LogTracer` automatically with default `tracing-subscriber` features enabled 💁♀️ * Update `DEVELOPMENT.md` documentation regarding `tracing` * Update default log level for development to make it less noisy --------- Co-authored-by: timvisee <tim@visee.me>
generall
pushed a commit
that referenced
this pull request
Aug 15, 2023
* Add optional `tracing` crate dependency to all `lib/*` sub-crates * Add optional alternative "tracing-logger"... ...that works a bit better with logs produced by the `tracing` crate * Make `tracing-logger` reuse `log_level` config parameter (and `QDRANT__LOG_LEVEL` env-var)... ...instead of default `RUST_LOG` env-var only * Replace `env_logger` with `tracing` (#2381) * Replace `env_logger` with `tracing`/`tracing-subscriber`/`tracing-log` TODO: - Implement slog drain that would *properly* convert slog records into tracing events (`slog-stdlog` is fine for now, though) * fixup! Replace `env_logger` with `tracing`/`tracing-subscriber`/`tracing-log` Fix `consensus` test * fixup! fixup! Replace `env_logger` with `tracing`/`tracing-subscriber`/`tracing-log` Forget to `unwrap` the result 🙈 * fixup! fixup! Replace `env_logger` with `tracing`/`tracing-subscriber`/`tracing-log` `tracing_subscriber::fmt::init` initializes `tracing_log::LogTracer` automatically with default `tracing-subscriber` features enabled 💁♀️ * Update `DEVELOPMENT.md` documentation regarding `tracing` * Update default log level for development to make it less noisy --------- Co-authored-by: timvisee <tim@visee.me> * Implement "intelligent" default log-level filtering --------- Co-authored-by: timvisee <tim@visee.me>
generall
pushed a commit
that referenced
this pull request
Sep 4, 2023
* Add optional `tracing` crate dependency to all `lib/*` sub-crates * Add optional alternative "tracing-logger"... ...that works a bit better with logs produced by the `tracing` crate * Make `tracing-logger` reuse `log_level` config parameter (and `QDRANT__LOG_LEVEL` env-var)... ...instead of default `RUST_LOG` env-var only * Replace `env_logger` with `tracing` (#2381) * Replace `env_logger` with `tracing`/`tracing-subscriber`/`tracing-log` TODO: - Implement slog drain that would *properly* convert slog records into tracing events (`slog-stdlog` is fine for now, though) * fixup! Replace `env_logger` with `tracing`/`tracing-subscriber`/`tracing-log` Fix `consensus` test * fixup! fixup! Replace `env_logger` with `tracing`/`tracing-subscriber`/`tracing-log` Forget to `unwrap` the result 🙈 * fixup! fixup! Replace `env_logger` with `tracing`/`tracing-subscriber`/`tracing-log` `tracing_subscriber::fmt::init` initializes `tracing_log::LogTracer` automatically with default `tracing-subscriber` features enabled 💁♀️ * Update `DEVELOPMENT.md` documentation regarding `tracing` * Update default log level for development to make it less noisy --------- Co-authored-by: timvisee <tim@visee.me> * Implement "intelligent" default log-level filtering --------- Co-authored-by: timvisee <tim@visee.me>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


This PR replaces
env_loggerwithtracing/tracing-subscriber/tracing-logas ourlogbackend (and also removes half of the custom features added in #2187).(Currently based on top of #2187. Would be rebased onto
devonce #2187 is merged.)TODO:
DEVELOPMENT.mddocumentation after removing custom tracing-related features fromqdrantcrateMaketracingrequired dependency oflib/*crates and remove customtracingfeature everywhere?tracingoptional inlib/*crates, so I crossed it out.Further Improvements:
/log_levelHTTP endpoint to get/set log-level at runtime #2383)tracing_subscriber::reloadRollingFileAppenderfromtracing-appendercrate does not yet support practical rollover strategiestracing-rolling-file, which looks fine, but I haven't tested it yetslog-stdlog(that we are currently using) is fineraftcrate actually emits any, but it would be kinda silly to useslogif it does not, so I assume it doestracing-slogis mostly uselessslogand any specific "slog-to-tracing" bridgeslog-stdlogis perfectly fine if you don't want/need KV pairsAll Submissions:
devbranch. Did you create your branch fromdev?New Feature Submissions:
cargo +nightly fmt --allcommand prior to submission?cargo clippy --all --all-featurescommand?Changes to Core Features: