Skip to content
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

Add configurable logging filter #49

Merged
merged 2 commits into from
Apr 2, 2022
Merged

Add configurable logging filter #49

merged 2 commits into from
Apr 2, 2022

Commits on Apr 2, 2022

  1. Add configurable logging filter

    Filters identify log messages to filter out, so that the logger does not
    log messages containing any of the filters. If any matches are present
    in a log message, the logger will not output the message.
    
    The environment variable `LOG_FILTERS` can be used to specify filters as
    a comma-separated string, like `LOG_FILTERS="/health, /heartbeat"`. To
    then add the filters to a class instance, the `LogFilter.set_filters()`
    method can make the set of filters from the environment variable value.
    
    One of the primary use cases for log message filters is health checks.
    When applications with APIs are deployed, it is common to perform
    "health checks" on them. Health checks are usually performed by making
    HTTP requests to a designated API endpoint. These checks are made at
    frequent intervals, and so they can fill up the access logs with large
    numbers of unnecessary log records. To avoid logging health checks,
    add those endpoints to the `LOG_FILTERS` environment variable.
    br3ndonland committed Apr 2, 2022
    Configuration menu
    Copy the full SHA
    32792cd View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    fba2fd2 View commit details
    Browse the repository at this point in the history