Structured logging for Python with pluggable pipelines and transports
Project description
logfn-python
Structured logging for Python with pluggable pipelines and transports.
Features
- Structured Logging: JSON-based log events with consistent schema
- Log Levels: trace, debug, info, warn, error, fatal
- Child Loggers: Create scoped loggers with inherited context
- Pipeline Stages: Pluggable event processing (redaction, enrichment, sampling)
- Multiple Sinks: Console (pretty/JSON), HTTP (batched with retry)
- Type Hints: Fully typed with Python type hints
Installation
pip install logfn
Quick Start
from logfn import dev_logger
logger = dev_logger("my-app")
logger.info("Application started", version="1.0.0")
logger.warn("Deprecated API used", api="/old-endpoint")
logger.error("Request failed", status_code=500, path="/api/users")
Basic Usage
Creating a Logger
from logfn import create_logger, SinkConsole
logger = create_logger(
name="my-service",
level="info",
sinks=[SinkConsole(json=True)],
)
logger.info("User logged in", user_id="123", email="user@example.com")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
logfn-0.0.1.tar.gz
(8.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
logfn-0.0.1-py3-none-any.whl
(8.0 kB
view details)
File details
Details for the file logfn-0.0.1.tar.gz.
File metadata
- Download URL: logfn-0.0.1.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a4cbb4c5ad74e65113e2dde0290f8b11cf6601228e7bc48d43c5db08266322a
|
|
| MD5 |
839a7e16697d8f82c55c0655cc2a27b1
|
|
| BLAKE2b-256 |
d9f2e2394e8e0bf67647472e704129d35b8bbde82a0f7d3dc14cdc9d191d2930
|
File details
Details for the file logfn-0.0.1-py3-none-any.whl.
File metadata
- Download URL: logfn-0.0.1-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
158c65e79e6ac3a0e04781f48614ed4212b2512c61624b86495610dc02483337
|
|
| MD5 |
7552d0a20759b93ddcff98bdaf2331f9
|
|
| BLAKE2b-256 |
61d69e38508afc7d4769c4b4ef384653a3499a510384bda591f28a7ec6b19a54
|