Skip to main content

Fastest Python logging library — Rust-powered, stdlib-compatible API

Project description

LogXide

Up to 13× faster Python logging, powered by Rust.

Same stdlib API. Same getLogger. Same format strings. Just faster.

# Before                              # After
import logging                        from logxide import logging

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger('myapp')
logger.info('Hello, world!')          # Up to 13× faster. Same code.

PyPI Python License: MIT CI

Installation

pip install logxide
# With Sentry integration
pip install logxide[sentry]

Performance

LogXide is performance-first: its native Rust handlers dispatch on the GIL-released fast path, formatting and writing without materializing a Python LogRecord. As of 0.2.0 the text-sink wrappers (FileHandler, StreamHandler, RotatingFileHandler) emit through that native Rust path by default; a handler only falls back to the Python path for a custom Formatter subclass, {/$-style format strings, or a handler-level Python filter.

Cross-library durable throughput (sink-verified)

Measured with benchmark/basic_handlers_benchmark.py on macOS M4 Max, CPython 3.14.2, release build, -n 20000, each library in its own subprocess. Durable = records the sink actually confirmed after flush (every row verified at 20,200 / 20,200), not records merely enqueued. Numbers are machine-specific and rounded:

Sink LogXide durable rec/s stdlib LogXide vs stdlib
FILE ~739K–960K 74,605 ~10×
STREAM ~273K 53,292 ~5×
ROTATING ~202K 42,981 ~4.7×

LogXide leads every sink. On STREAM, Structlog is the runner-up (~117K rec/s, ~2.2× stdlib) but still well behind LogXide. Full tables, per-library p50 latencies, and async delivery accounting are in docs/benchmarks.md.

vs stdlib, single-format FileHandler (subprocess-isolated)

FileHandler benchmark, Python 3.12, 100K iterations, format "%(asctime)s - %(name)s - %(levelname)s - %(message)s", LogXide vs stdlib with stdlib in a subprocess for fair isolation. FileHandler is synchronous, so these are durable numbers (no async drops). Figures are machine-specific:

Scenario LogXide stdlib Speedup
Simple 1,922,911 145,562 13.21×
Structured (f-string) 1,612,029 144,328 11.17×
With %s args 976,572 144,156 6.77×

Python 3.14: LogXide is also faster (4.25–7.23× vs stdlib), though the absolute gap narrows because stdlib's per-iteration overhead is lower under 3.14. See docs/benchmarks.md for the full Python 3.14 table.

For per-handler latency, async accounting, internal optimization wave breakdown, and historical comparison data, see docs/benchmarks.md.

Works With

LogXide intercepts stdlib logging — most libraries work without changes.

Framework / Library Status Notes
Flask app.logger automatically intercepted
Django LOGGING dictConfig supported
FastAPI / Uvicorn All uvicorn loggers intercepted
SQLAlchemy SQL query logging via echo=True
requests / httpx HTTP connection logs captured
boto3 / botocore AWS SDK logs captured
Sentry Native integration — auto-detects an already-configured SDK
Celery ⚠️ Requires setup_logging signal (guide)
pytest ⚠️ Use caplog_logxide instead of caplog

Full compatibility guide for 20+ libraries →

Built-in Sentry Integration

No extra handlers. No configuration. Just works.

import sentry_sdk
sentry_sdk.init(dsn="your-dsn")

from logxide import logging

logger = logging.getLogger(__name__)
logger.error("This is automatically sent to Sentry")
  • Auto-detects a configured Sentry SDK (a call to sentry_sdk.init() must have run first)
  • WARNING+ sent as events, INFO as breadcrumbs
  • Full stack traces and custom context

An installed-but-unconfigured Sentry SDK does not attach a handler, and (as of 0.2.0) importing it no longer forces process-global caller-frame collection onto unrelated handlers.

Native OpenTelemetry Support

Ship logs to any OTLP-compatible backend with zero dependencies:

from logxide import OTLPHandler

handler = OTLPHandler(
    url="http://localhost:4318/v1/logs",
    service_name="my-service"
)

Quick Start

from logxide import logging

# Basic setup — same API as stdlib
logging.basicConfig(
    level=logging.INFO,
    format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
)

logger = logging.getLogger('myapp')
logger.info('Hello from LogXide!')
logger.warning('This works exactly like stdlib logging')

Custom fields with extra

logger.info("User logged in", extra={
    "user_id": 12345,
    "ip": "192.168.1.1",
    "metadata": {"browser": "Chrome", "version": 120}
})

HTTP log shipping

from logxide import HTTPHandler

handler = HTTPHandler(
    url="https://logs.example.com",
    global_context={"app": "myapp", "env": "production"},
    transform_callback=lambda records: {
        "logs": [{"msg": r["msg"], "level": r["levelname"]} for r in records]
    }
)

What's Different from stdlib

LogXide reimplements Python's logging in Rust for speed. The API is the same, but some advanced stdlib patterns aren't supported:

Feature Status
getLogger, info, debug, warning, error, critical ✅ Same API
basicConfig, format strings, levels, filters ✅ Same API
FileHandler, StreamHandler, RotatingFileHandler ✅ Rust-native
HTTPHandler, OTLPHandler ✅ Rust-native, high throughput
Custom Python handlers via addHandler() ⚠️ Accepted; runs once on the Python side (no fast-path GIL release)
Subclassing LogRecord or Logger ❌ Rust types, not subclassable
pytest caplog fixture ⚠️ Use caplog_logxide instead

Instead of subclassing LogRecord, use extra={} for custom fields, global_context for metadata, or transform_callback for output transformation.

Compatibility

  • Python: 3.12, 3.13, 3.14 (fully tested and supported)
  • Python 3.15: Not yet supported — blocked by an upstream pyo3 ↔ Python 3.15-alpha ABI mismatch (the compiled extension references a CPython internal symbol _PyType_FromSlots that current 3.15 alpha builds do not export). Tracking for re-enablement once pyo3 ships a 3.15-compatible release.
  • Platforms: macOS, Linux, Windows
  • Dependencies: None (Rust compiled into native extension)

Documentation

Contributing

git clone https://github.com/Indosaram/logxide
cd logxide
pip install maturin
maturin develop
pytest tests/

See development guide for details.

License

MIT License — see LICENSE for details.

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

logxide-0.2.0.tar.gz (1.1 MB view details)

Uploaded Source

Built Distributions

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

logxide-0.2.0-cp314-cp314-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.14Windows x86-64

logxide-0.2.0-cp314-cp314-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

logxide-0.2.0-cp314-cp314-macosx_10_12_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.14macOS 10.12+ x86-64

logxide-0.2.0-cp313-cp313-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.13Windows x86-64

logxide-0.2.0-cp313-cp313-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

logxide-0.2.0-cp313-cp313-macosx_10_12_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

logxide-0.2.0-cp312-cp312-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.12Windows x86-64

logxide-0.2.0-cp312-cp312-win32.whl (1.0 MB view details)

Uploaded CPython 3.12Windows x86

logxide-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

logxide-0.2.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl (1.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ s390x

logxide-0.2.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (1.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ppc64le

logxide-0.2.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARMv7l

logxide-0.2.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

logxide-0.2.0-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.whl (1.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.12+ i686

logxide-0.2.0-cp312-cp312-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

logxide-0.2.0-cp312-cp312-macosx_10_12_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

File details

Details for the file logxide-0.2.0.tar.gz.

File metadata

  • Download URL: logxide-0.2.0.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.14.1

File hashes

Hashes for logxide-0.2.0.tar.gz
Algorithm Hash digest
SHA256 bb8d87d346ff0f86ea73d6dca19e7bbaf9c807688495c7f0c1f6d9547b2a6064
MD5 fee7b70761ec45051076551e3e5cec2e
BLAKE2b-256 66c3d2cc9ace70cc1258a51b05f5d405058dee4547b37036e58342065d75f1f5

See more details on using hashes here.

File details

Details for the file logxide-0.2.0-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: logxide-0.2.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.14.1

File hashes

Hashes for logxide-0.2.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 b1ff6300a4f88d36cb2dd38eb6e537178cf1e29b83a6d2e52d8c300f91b4233c
MD5 8e57fb72ab1065b35c6180ed72ef52c9
BLAKE2b-256 17888f42e32b002ee68f5d60e50f4d32e89dcb8d714c0a4ea8aafe3ffb0ddb09

See more details on using hashes here.

File details

Details for the file logxide-0.2.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for logxide-0.2.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c3435821f2bae957bac47d754db5783e08a18b48e6a7dcec9fc6c06a873a9ec4
MD5 ff2b370847c5ba10f1995dcfc4327741
BLAKE2b-256 1693995a0f7b2e1a6bb34b1a3ed6fdde615df220b729efd79fce65d0a6db4cad

See more details on using hashes here.

File details

Details for the file logxide-0.2.0-cp314-cp314-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for logxide-0.2.0-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 814484f6898868785619241d1c6566116cc0c8b576b6ea50fbc44501c49170e0
MD5 b1a333b2beffb2dbd74798425f914019
BLAKE2b-256 57ac6398690893eacd4ce68fd292b5b9ce1d536805185b808b95911c7ae878bc

See more details on using hashes here.

File details

Details for the file logxide-0.2.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: logxide-0.2.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.14.1

File hashes

Hashes for logxide-0.2.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 447d3f8ca4fd48136d5501a885d5133c6ec9f830a37168c9b93b2a08f8fc3560
MD5 6f1df36d8449591f47d7f7125286ccfb
BLAKE2b-256 da4e7dffc549df96a6cb993a1c170acae42ee5068290d48db1592c4fbe7bc608

See more details on using hashes here.

File details

Details for the file logxide-0.2.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for logxide-0.2.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fc3710eb41847f2b5257e2df1d0bc1cef0ac92817a79edf7ef72b158a008e113
MD5 48580c5c7a69159eaeab3bd76cbb431a
BLAKE2b-256 fcf674b5306d02d6a1cdbd3b5c86bdf87f02259c66e2ead256fc4b56af1bd54b

See more details on using hashes here.

File details

Details for the file logxide-0.2.0-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for logxide-0.2.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 2d9ce8f5921168d23da5b3215edd2fa7195206c219378dbb1d7365e7014b0780
MD5 261309828c05ba9d30322d7c348d75c5
BLAKE2b-256 ca8b0bf520973e97396627b2f1d4a34a81f7b8b98a4009adc19b15090b434805

See more details on using hashes here.

File details

Details for the file logxide-0.2.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: logxide-0.2.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.14.1

File hashes

Hashes for logxide-0.2.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 34483c5fa63a39fcd35ca78e99f1bece9e94a76d7f9e4d7d5d649a6baebc5ace
MD5 68cae01668f156138b9e49943d1a0847
BLAKE2b-256 f69f0952b537fc89953e7359a5ca3ec1817726272f927c2b97764d864b78bcd0

See more details on using hashes here.

File details

Details for the file logxide-0.2.0-cp312-cp312-win32.whl.

File metadata

  • Download URL: logxide-0.2.0-cp312-cp312-win32.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: CPython 3.12, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.14.1

File hashes

Hashes for logxide-0.2.0-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 89666b898e3cb85b6dcfaf696fc241532316f5dbb2a061443d48da576bd047cf
MD5 47d56bc3a61664ce5b88e1f3e8984b97
BLAKE2b-256 298d6d44755cb9f81c6e506c061305522bdc168fb1bab1c61a9155705b110271

See more details on using hashes here.

File details

Details for the file logxide-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for logxide-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0060c6a3d670d1800412b0164810da47c64892837e8ea18d45582881d78591d3
MD5 ea2e5d8e657a77e6cfa1565b4ccfd6ea
BLAKE2b-256 e7ae10a0e908edf92c150d7b812f6b14c28e098daa75e3e21a9ab21d489644fa

See more details on using hashes here.

File details

Details for the file logxide-0.2.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl.

File metadata

File hashes

Hashes for logxide-0.2.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 102d5ec0e8c2d9d7ef18924927ad7a8d25fc4490c18bb29cb4b1169db0255a23
MD5 26c23f45c2977a49dabf1e6d02a12097
BLAKE2b-256 99aec0de3fc076dc25bda2febb0d0fc4a10702fd9c66d7f9e75bb29aaad273c2

See more details on using hashes here.

File details

Details for the file logxide-0.2.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for logxide-0.2.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 8ba03d01cf3320092c5e1d24497000da9d2b1639aabd61c802c4ad8e06278847
MD5 3ebca03617682053ce9c927551afb18c
BLAKE2b-256 ec7220684f1fa210214530dfd53c9c31cfa9334807b2a9684ac71d15906afc71

See more details on using hashes here.

File details

Details for the file logxide-0.2.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for logxide-0.2.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 42877092b16e52a1f6d969b1b8cace94566d6f129b881a60d72b031fe445fa29
MD5 126f4c941b41ef7fb78359209a980373
BLAKE2b-256 efa0ea09e6ec9090191105199bb6747d8588540dec8e6a1224c484871644266b

See more details on using hashes here.

File details

Details for the file logxide-0.2.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for logxide-0.2.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 8aa28add732471074cc2cfa2fb5a82405c02288b38bb675913c539c789f49935
MD5 c4757e5720780265e60f37d3c7bc7aee
BLAKE2b-256 cd90d937e52ffdc4dfafb26d9a1030ba29d3a81fd1cf67de38feacf96a7d7ce4

See more details on using hashes here.

File details

Details for the file logxide-0.2.0-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.whl.

File metadata

File hashes

Hashes for logxide-0.2.0-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 8b647101141856a267e091f5474fa27950da2e71ebac558652b915601c96d467
MD5 adf35b98cc73e7063a80129bcbe46374
BLAKE2b-256 ef7def7fd5cac3a782e08d21e3a2f7a18b7d5405b7fc33622672737ba3210187

See more details on using hashes here.

File details

Details for the file logxide-0.2.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for logxide-0.2.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 54064dbf435fa8c9ac6c80d2d2dc4337d024a991fc14249ab40b78439164bf2f
MD5 0bd907c7f731c005499249fefdc28e70
BLAKE2b-256 dc7547a4805e2b9568005551fc2a086c98b47fb11af0a78c2825c7300afe8d37

See more details on using hashes here.

File details

Details for the file logxide-0.2.0-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for logxide-0.2.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 59e29ce41919f50c087fa49988ff22a8d768e2c6fc37fb65e53aa7ecdb19dec4
MD5 a52fbf056dc947bc28ca03e99f019f58
BLAKE2b-256 882f88980efb61b0e6ba600564a6867fb4c6a66daf86ba38607c81781fb4ec58

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