Skip to content

Enable increasing tracing level without increasing the log level #5959

@spew

Description

@spew

Currently, to enable debug level tracing, one sets the environment variable RUST_LOG to debug. This aloso increases the log level to be debug which often is not desired. The request is to add a new, appropriately named environment variable, such as RUST_TRACE, which can be used to independently change the tracing level.

From scanning the code I believe this is why, (1) is where tracing is configured. It uses this function (2) which uses RUST_LOG, if it could just read from RUST_TRACE instead that would give us what we want. However, (2) is also used at (3) for logging, so it could be changed to have the log level passed in and read from different env var for log vs trace:

  1. .with_filter(startup_env_filter(level)?),
  2. let env_filter = env::var("RUST_LOG")
  3. let (reloadable_env_filter, reload_handle) = ReloadLayer::new(startup_env_filter(level)?);

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions