-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace env_logger
with tracing
#2381
Replace env_logger
with tracing
#2381
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 💁♀️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some crates are using |
Yeah, that seems more reasonable. Maybe we can set that as default here. What do you think? |
* 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>
* 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>
* 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 PR replaces
env_logger
withtracing
/tracing-subscriber
/tracing-log
as ourlog
backend (and also removes half of the custom features added in #2187).(Currently based on top of #2187. Would be rebased onto
dev
once #2187 is merged.)TODO:
DEVELOPMENT.md
documentation after removing custom tracing-related features fromqdrant
crateMaketracing
required dependency oflib/*
crates and remove customtracing
feature everywhere?tracing
optional inlib/*
crates, so I crossed it out.Further Improvements:
/log_level
HTTP endpoint to get/set log-level at runtime #2383)tracing_subscriber::reload
RollingFileAppender
fromtracing-appender
crate 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 fineraft
crate actually emits any, but it would be kinda silly to useslog
if it does not, so I assume it doestracing-slog
is mostly uselessslog
and any specific "slog-to-tracing" bridgeslog-stdlog
is perfectly fine if you don't want/need KV pairsAll Submissions:
dev
branch. Did you create your branch fromdev
?New Feature Submissions:
cargo +nightly fmt --all
command prior to submission?cargo clippy --all --all-features
command?Changes to Core Features: