Skip to content

Add support of dynamic log level #86

Closed

Description

@zuston

Thanks for your great work of logforth, I used this into the storage service.

if logforth is used in the production environment, sometimes we want to temporarily adjust the log level to print out some logs for digging. Is this possible to support this in logforth?

Activity

  1. tisonkun commented on Jan 3, 2025

    @tisonkun
    Contributor

    temporarily adjust the log level to print out some logs for digging

    For this purpose, in our use case, we typically use the RUST_LOG env to enable debug level logs, like:

    RUST_LOG="debug" ./your/app
    # or 
    RUST_LOG="info,specific_mod=debug" ./your/app

    This follows the most common used env_filter

    If you'd like to use more dynamic rules, you can use the CustomFilter for define your rules, and even with a global state to check so that you can modify it at runtime.

    I'm glad to hear your concrete use case and see if we can integrate it at the upstream.

  2. locked and limited conversation to collaborators on Jan 10, 2025
  3. converted this issue into a discussion #94 on Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions