Skip to content

How to integrate hypercorn's loggers into existing logging setup #40

Description

@dkbarn

I am using hypercorn in my application with the Python API rather than the command line. How can I integrate hypercorn's logging into an existing python logging hierarchy? From looking at the source of logging.py, there is no way for hypercorn to create only the Logger objects without the Handler objects.

It is not the responsibility of a library to create and manage logging Handlers -- this is the job of the top-level application to control, which all dependent library's will adopt. So it makes sense for hypercorn to create the Handlers when using the command line since it is the top-level application. But when importing it into a Python application, it should only create the Loggers and not the Handlers, so that all log messages from the entire application share the same setup.

How can this be achieved?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions