hynek / structlog

Simple, powerful, and fast logging for Python.

Home Page:https://www.structlog.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to configure different loggers separately?

Dankko0w0 opened this issue · comments

structlog.configure() seems to be the global setting. I need to create two different loggers with different settings, like:

logger1 = structlog.get_logger()
logger2 = structlog.get_logger()

logger1.configure(
    processors=[do_something1],
)
logger2.configure(
    processors=[do_something2],
)

Hope someone can give me the right solution, thanks!