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, 3.15 (All fully tested and supported)
  • 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.20.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.20-cp314-cp314-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.14macOS 10.12+ x86-64

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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.12+ x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12Windows x86

logxide-0.1.20-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.1.20-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.20-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.20-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.20-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.20-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.20-cp312-cp312-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

logxide-0.1.20-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.20.tar.gz.

File metadata

  • Download URL: logxide-0.1.20.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.20.tar.gz
Algorithm Hash digest
SHA256 5dbcedbb1cf54218d57f3ee5b9e74ce4fbd79772fd4d8d32bb687b66d02e2589
MD5 cab3861957424b1ffebd85b06d8bd539
BLAKE2b-256 ad73fe24f9d529b4613b0f39f2364de1fca081e371881146d1372442e6375eac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.20-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 3b811bf5f510711c80b782b97850e59d8922683aadab348e2677d4d7cc14c96d
MD5 3118c55bd3593fa1722ecbd790cbc8c5
BLAKE2b-256 85bf04756f68c4390a5cb38f1b61ac11dec651e0d597cc82af40e3aa9adc7956

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.20-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 27db5c35a1ac7cf11e83316acf1de074297f5ffb638938e09c58461f87fc72d6
MD5 244af5b7ea9f5445ac782bcc5eddf962
BLAKE2b-256 7198d39fe978274513918410fe62f1599e836976b1bf4d04dc0777d95e213894

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.20-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 21a3007887fa9a3893ded701dcf334e1d4732cc3a1d946ae365d76eebb7eeaac
MD5 22e6e788104219ee837167b471b0df6c
BLAKE2b-256 f2e6e7ab8ff806c914e9ffa1e1a5ae7798e502f6dc16af196fdb222fa25547cb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.20-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 c712c83923b3ce224e8dc9d70d6294d99cf8e9d8d5c2ef53ffdcaae927d2bbad
MD5 272d8a1bf78365a593315ee727859dfa
BLAKE2b-256 2b365a6cfe6ebf0a08fd550f4bdbe670d9c8543f8c076862857b911ab7f96bb8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.20-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 04562364f06a3ed6c413c903e38a53681ad63da2f65c78fae87fbc1cac423393
MD5 05a7b4c13594ea06c242f2f21a8e6f2b
BLAKE2b-256 f16bd1af305e65e54dcaf5a5e9dd689b2e8e59cc04252f1f15a475881c0acd0a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.20-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 9e31f6711e3ee2548f1a8f6ed17a05e3560b47e0fd901d1da3ef951c3d47a757
MD5 73a0b4ff37383f75bb33c942e6394a34
BLAKE2b-256 f79fc93b2229c4193d408a3e87b93d70e8f11150abe2b6c98676db9b89c7408e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.20-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 91c3edd9981bceddf46d8994c1bbe30db40ed3b30fe0d804e72121e97afc46a1
MD5 5e797515575653d7ce008464c8d22f17
BLAKE2b-256 2fffbf847ef382c2126910cd861e8b70e8c38f3d501a403d6b5fcdb0ac1c756c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: logxide-0.1.20-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.20-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 6f598f7372c1f48cff19bc1f024a00001e2f68aba815667ecb0936793d9fde72
MD5 b8d0952bb4242a7c573abf6030867800
BLAKE2b-256 dac1a0430c42ac7324ab846ce94480ea0daa849bc9a6238875fbc8806161050c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.20-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a2a625e7a3710d9d8e13e85247eec13796ec7b3e616f82c5e9da46e0ebe26ee3
MD5 14d2d1d8083476a42ad7159a2412e82b
BLAKE2b-256 fc25f3d149c8328a147be08e88e1afb1158c3770d5b0220a754d56be554e525b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.20-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 aa048c7651585bad74d88b2b42c02f70ecd78d8934b2270296c65e8d2542e02e
MD5 32a13fcda3c82f56207cc7461631f978
BLAKE2b-256 656601cf60464fd547d22424db8b5750caa40c8a7adcc15af24448c16f39bf82

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.20-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 ebd56818fde43cc57a94487c601b2c936e42639d0130ebea7e5e0929b77f01b9
MD5 b99438f81ae321871b0cd69d3c8e9711
BLAKE2b-256 f619fc22d7ba30128600abd9795af68783e668616cb9d777c0455a44b18a7fbb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.20-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 cf926f2cca0cae9b38e4f820cd528bf0c4bb4383c0c0c3e3d75a496a89b0b0ac
MD5 539e35f2b7dce92d5654bf477c21840c
BLAKE2b-256 98d9423e3c46736374747b120b315f37a66c12401d12671292b7539267c8840e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.20-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 83a1a5f81f2141c57baeb4315f48e4f872497d003f46be2a422096f6360f4c38
MD5 e102476bda75cd8c71220f92ee63580a
BLAKE2b-256 b376770b2b6d465d621479bf1f507402db04afcd620cbce88e19b86a95a1914e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.20-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 421b370df0163e3e093d82e0d4b68713d596c86aeff1346d8cd8207fa946d980
MD5 52a9a8394dbc694664b5b614123b004b
BLAKE2b-256 b002d71c6a7c569043f5ded31e96e5576ca01c90ae9851b5f4a1192b8171bab0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.20-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1f516356a0073cdabe41dafc7df8e14e41abd0cdbd7024d973bef06c01ababf4
MD5 96167626e84fbd5ac48e3ad193ea2542
BLAKE2b-256 1e73fc333f4dd9370841f785ff279f3a704c3a24d081efd0acfb38258a0a8fab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.20-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ec7f3628f118f99ac36b3542a66eb76b23a38a6122560e2baf2ef9ede2416304
MD5 7cc2893349d765282f3777f0a570921f
BLAKE2b-256 6cc3a77afc0c10de22d9f78676443096123c5e0361bd012d12272a27817e65a8

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