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

FileHandler benchmark, Python 3.12, 100K iterations, format "%(asctime)s - %(name)s - %(levelname)s - %(message)s", stdlib runs in a subprocess for fair isolation:

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×

Same Python 3.12 across all libraries (10K iterations, basic_handlers_benchmark.py):

Library Ops/sec vs stdlib
LogXide 1,139,874 7.85×
Structlog 932,755 6.42×
Picologging (C) 384,319 2.65×
stdlib 145,260 1.0×
Logbook 99,538 0.69×
Loguru 93,896 0.65×

Picologging note: Cython-based, supports Python 3.12 only (incompatible with 3.13+). Picologging skips sys._getframe() caller-frame extraction; LogXide performs full stdlib-compatible introspection on every record where the format string requires it.

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, 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 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 Sentry SDK
  • WARNING+ sent as events, INFO as breadcrumbs
  • Full stack traces and custom context

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 alongside the Rust pipeline (may cause duplicate processing)
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.1.22.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.1.22-cp314-cp314-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.14macOS 10.12+ x86-64

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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.12+ x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12Windows x86

logxide-0.1.22-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.17+ s390x

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

Uploaded CPython 3.12manylinux: glibc 2.17+ ppc64le

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

Uploaded CPython 3.12manylinux: glibc 2.17+ ARMv7l

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

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

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

Uploaded CPython 3.12manylinux: glibc 2.12+ i686

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

Uploaded CPython 3.12macOS 11.0+ ARM64

logxide-0.1.22-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.1.22.tar.gz.

File metadata

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

File hashes

Hashes for logxide-0.1.22.tar.gz
Algorithm Hash digest
SHA256 f6af577217948244afbd993a5cb137f0283013432eed7d5daf37b967dd962562
MD5 fe68072d6acc058fafc24e2847349219
BLAKE2b-256 d61c37ecf0f1b7d52ab3777f2e6385eab2a3ab5e1315f6a65d2823c7093b0d8e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.22-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 754a375f1e5df77a810b491581e737c833cb84f6e98f4fbde51cd9eb5dbec3a0
MD5 001e31ba5bb297ebf1260e73482329e3
BLAKE2b-256 0b6929f94b6cc0ced632cc213ba3836ca890783a2fc20d509c061c8eb3125ffe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.22-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 977b86eabe45b4f6c3ed410b28c47c4e4bd6f9cf72b32688314dba02bfc1469e
MD5 7e6721ac5db78e40253f22ee70c4a4b9
BLAKE2b-256 7d65e9ae3c1bab58e1182c1e41f7b900260963ce67d5e48bc9b75c9e0ab698c1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.22-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 6f681df77188abdba2777aea406ed225a683d9f4bde885966703934db3ba9010
MD5 6ec93977dfcc351b5002df12f6aa87ae
BLAKE2b-256 f2f36d96faeaef4ed766206a923be62112ae8ac074e22f0adf2b0ecfac974cc0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.22-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 cf6cd21f6d1d61fcf00d3c7c045a4c03a0fe05f4bd20b6196fbe25527a9eec6c
MD5 d48350f821689d9484daad24f43170c5
BLAKE2b-256 55a99b66e6bbc3f4f8b7b97c3382e456c6adf4b7109699b369b75942262a29b7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.22-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 763f9d4602f788d045fe412d02ea111d4a7b3d10d8257cb866d3c7df452ee69e
MD5 e595aa5d57c0eb36ad201dac32822f80
BLAKE2b-256 c8163d6b1697acd0c6a7a8e30755cd6db8ccbab5dc771ee7fff126fb529fb458

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.22-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 be037006e8695cc24c647f6b51094d6c00a76454517eebfdfcd90e820ce6b190
MD5 b9427687bc1d72485ba44bf40a8a0605
BLAKE2b-256 8ac85cf0e37afad68abc2ed95c8ffedcf6f950a14d6ed395921fead6a1669a2c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.22-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 601204a2234ee554e9a2a57819ab7b901888b02df304e384ef8b5f120b25b181
MD5 622f831aa48366d604e5e28c52eab3b5
BLAKE2b-256 80002d4d41971a5ff1ff3c651d83bc9d1e1f7edf56c8cc41752d7134a0bb596c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: logxide-0.1.22-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.0

File hashes

Hashes for logxide-0.1.22-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 84756af43885a344a26ca898af8264f30f74d18d8c75c8d849a7976dd1712ec6
MD5 447838056eba04ef9a3d8d9e344bc247
BLAKE2b-256 b765ccba66a8735f4b93b680098acf0c72250074e26f4105bf12064778a1ba30

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.22-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 56d1dc0f64cedac4347bf29ca0093eef04a82aca950656f9fe89e3493d496afc
MD5 fa4e8f95bd14d7763597fa604654cef6
BLAKE2b-256 cca7b7ebbeb828b814efe03ede0ef0535001b249e08658c537072a98a8dbe96d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.22-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 2f53e7cdc8bb26a6d8f0abd4a5404e0fdb57656e531f18a560dfff75b12569f3
MD5 f5420f8a62450bbe283e9f18a2c16684
BLAKE2b-256 b7360700c3f05c9b1b30eb87b208a55fa07e8b0da661071f88b5d1489b6914e0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.22-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 ef8387e8b914eb24736c3adc43d24c6b58a876a36242e5b7c8d2954cd7c90c19
MD5 6d16cc947f8c3830b3b9fbfc52ad29c4
BLAKE2b-256 34872e57f1ed5655264534ee98ab9ca9bf9bcd6000d66d6637cb58e0877e762f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.22-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 e7816484649752cebadd3cd3cf5521f1bddda54b9e8737ed77f42234b960c11e
MD5 3701667cef1ab7da25a77a3555c203f4
BLAKE2b-256 c8356d9decb791af4810d0bb6b29f34f47731e135ae00e567ef65602deedabbd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.22-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2d784c050eb7e9e12ee5cb30215a1ada89410b5933f4b96e01fa7dceead19a34
MD5 b501486ba85a3d95f9ca4198b8ce0197
BLAKE2b-256 7699ed415444e69b8715233365ed52daa6b0937c0e8e11309516bc9877464d89

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.22-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 6a61b25bec7329bbe0c248fd021957a9c3fa95ce6662432074fdd595d7c4e2b9
MD5 3e1d0301270dd569f42530ccb739ba3c
BLAKE2b-256 c7c4d1f745ae01bb3b12082ce8f30b271a5d111997940f364779b0cbf896fab7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.22-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8ec3adc5b1dcd6b5396809b1ce105b4b65c759ff33caf35fe2ea5388c5c4ba89
MD5 a4cf5e1a568041eb8660b01279f30932
BLAKE2b-256 a77ffb1abfd1d2e4618493ae4dc4d5898d113867fbce1407837b2560a5d9a834

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.22-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 da1ea37870222e99aa980984237c0053bb65276466e670bb397a1807491a27e4
MD5 cc9f3c0bcc86890748f8f391ecdfc264
BLAKE2b-256 2224e8746002d29876e9f9964877138a3f3824ed3e78f310750b9bc0b39362f1

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