l2sl funnels log records of third-party tools into your structlog pipeline. In
addition, l2sl converts the text based log records into a structured representation.
You need l2sl if
- you are using
structlogas the logging library in your application, - you depend on third-party libraries, e.g.
uvicornorhttpx, that use theloggingmodule from the standard library for logging, and - you want the log records from the third-party libraries processed by the same
structlogpipeline as your own log records.
In the most minimal setup, you only need to do add one thing to your logging setup,
preferably after the structlog.configure() call:
import l2sl
l2sl.configure_stdlib_log_forwarding()Please have a look at the documentation.