Skip to main content

logging to structured logging

Project description

l2sl

What is this?

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.

Why do I need it?

You need l2sl if

  • you are using structlog as the logging library in your application,
  • you depend on third-party libraries, e.g. uvicorn or httpx, that use the logging module from the standard library for logging, and
  • you want the log records from the third-party libraries processed by the same structlog pipeline as your own log records.

How do I get started?

In the most minimal setup, you only need change two things:

  1. Add the l2sl.StdlibRecordParser() to the list of processors in structlog.configure.
  2. Call l2sl.configure_stdlib_logging() after you are done configuring structlog.
import l2sl
import structlog

structlog.configure(
    processors=[
        l2sl.StdlibRecordParser(),
        ...,
    ],
    ...,
)

l2sl.configure_stdlib_logging()

How do I learn more?

Please have a look at the documentation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

l2sl-0.1.2.tar.gz (34.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

l2sl-0.1.2-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file l2sl-0.1.2.tar.gz.

File metadata

  • Download URL: l2sl-0.1.2.tar.gz
  • Upload date:
  • Size: 34.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.6.9

File hashes

Hashes for l2sl-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f0f5b404a5891130810ee08b46d62e57577bc978f4af4c0ab1d444541dc806ee
MD5 a7ff1038df30b1aa58e937ca27e11418
BLAKE2b-256 44c12ec448efd33c8388273584ec3f8a64e9b4d14f6a43bfd1910113237187a3

See more details on using hashes here.

File details

Details for the file l2sl-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: l2sl-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.6.9

File hashes

Hashes for l2sl-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 766d41c87b546f5bc361f06b7dc8884ace2f7f197306cd63cb2ef7da73d59dba
MD5 f9308d94859944dfc5508b7189e6b791
BLAKE2b-256 db2a29ade5c3631464b4d3599d91640e34f8eebd2eaa9b3d10192173c479e64a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page