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.21.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.21-cp314-cp314-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.14macOS 10.12+ x86-64

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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.12+ x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12Windows x86

logxide-0.1.21-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.21-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.21-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.21-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.21-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.21-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.21-cp312-cp312-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

logxide-0.1.21-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.21.tar.gz.

File metadata

  • Download URL: logxide-0.1.21.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.21.tar.gz
Algorithm Hash digest
SHA256 3bd955f47f12713d67cdbdce6803803154c4323eac02be8e4f94f00db9ed8150
MD5 45c8a49747db4749c8a619fb8e592c08
BLAKE2b-256 948efefbe415ccb568d44e7183956c71a0b0c9c7c0f66364cf77dedbb2e8a2d3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.21-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 7be1ca8d9c813c9d248479f5beab86485be2070fcb6ad8fb80612390e2ae2ac3
MD5 9691258e523815390feaeba57566c100
BLAKE2b-256 1c244382459a3c4c7906dd0961b9ccee0bae809505e58303134b43affb69f530

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.21-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5284ea173155227679c062f8445aecee24c3ebe37cc6d68531b1e99d7b1fe5c3
MD5 669bde6eca781dc457240e38f1eb5902
BLAKE2b-256 84f7bce2062fcd4e81a0bebfe89d878e999b47f9a8a83599933167a83d0fa71a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.21-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b2aae59ab8ed557c1c41c16705d1b145f0fc1ef300e15fafd174e8838173b9cb
MD5 7a7fdd356272136cac684cbdc789da20
BLAKE2b-256 e08562d66c87ec65b5b4d8e70852ae2b1bd8a8f5bb583b570a4c085d5b67cbe0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.21-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 dedc61553ce1ae8e29c570b41eba10b322e8bac3542fc32a8981ce1258049974
MD5 dd4e93483941e5e987e7807ff9b07262
BLAKE2b-256 229748f029dcd01c528995dca94f1a8139025a9193507aa5c0ab609bc31af35e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.21-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5f7a3db7e3de1ad54bf69d99245e61c0f847fbd1cade0611814921146d857b8f
MD5 f8e10be6d6f740b945a1c4829c0bda88
BLAKE2b-256 d0eaf4ea84582c796b62bcdcc5788b3d6ce00cb291ef241ee55a2d8f308815a7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.21-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 46b68f9688f194993ae373baf71fcf8560630639ba802a4f3350e17caaf6b9b1
MD5 6b4670d32f671733847d8974d1c25b55
BLAKE2b-256 0bf755ae399a7cd26943090345cecb9af52ab3c905099db5fd6d4bb94f3c9949

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.21-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 cc586c8d4d80d37c01bf7ca30cb95689e83f2354dfeaa5752a93a310fc24f9e5
MD5 e06463a2b6cd67e3328e508997485703
BLAKE2b-256 3d8143d39d5cdee84a77c7e89f0337c89a2fc0602279c40ccc79369039afc648

See more details on using hashes here.

File details

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

File metadata

  • Download URL: logxide-0.1.21-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.21-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 dc5319adea148aced3dd4e17619df1eb34a7e8fb1b1fc62c603a93d3a89ddfe6
MD5 a8c810a759e44bc36a052dad38df225a
BLAKE2b-256 8004d1399fd2c824c8209f95dd084635bf6b2b94d25c8bdd29ce07ba5b60cf02

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.21-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1f2f7a0f5fbc88734da2651d3f893efdeeac32d9cca310e1c927ef5c618e6e8f
MD5 337c3ac21c36214112c7930ffc04557f
BLAKE2b-256 5ddffba3e42028ea53e319cc38a029bc0978c25f03b60850b23e8064d4bdf3a5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.21-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 a49064d90051d47daaadbbe6317ff41eb81efcaa54ce7761f6db8161426106b4
MD5 367edd4fdfb604df5380edb277753fd3
BLAKE2b-256 1bbaa3ba73555eef64cca38aa6f6836edeefe467345c9185d64de69084da8339

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.21-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 d6f2e89f682aa816a81d31de5734e06eb26896e0284a9898e316f825559e9945
MD5 448468fa0f521c5ddd6f6159deed911f
BLAKE2b-256 5d37339cf5fa9d26032e87cc39ab0c62a6443469d52add0127d72dfc0be2f2a9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.21-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 d827cbe5954bf92b87d283137ab66f390c5b025a9723d550df94ddff9f94e7f2
MD5 1225da78a81eb2fb1a1a4c8a22e0e4b4
BLAKE2b-256 aff2dcaeda493d7f62a9f262e11ee4056b2b8a6597a850c54a9167de92363764

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.21-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 be3b92a7e0bb103515ec6459cab6c60435cd2561665f474b95c083e476dfa62d
MD5 f3c2816ab2247282f632005612c755e5
BLAKE2b-256 476416c8239f5e014358bb213120d9d2d0a15e798d00ea31b05fe571da865d82

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.21-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 4b42dee8703892e556ae40c095bb9f98aaa4d862f7ca0d2b0760f35592120c09
MD5 ee38350543fa319054a162020ae10012
BLAKE2b-256 6dbdb1b06d4ef526c35bf326d51c1b61f5f63ab34ac95bf765a415a43125771c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.21-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 86b1698a3961d054162fd155a6b12ff1d9ef8a0a01e89f1106e38501ea01e6ab
MD5 5ea9e9869b89b4e5db14ca910530691f
BLAKE2b-256 0a84debc61667b91c2e6eb258cd8eb60ae92069092b11ce688c95f15abfe2fc9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.21-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 02e1691eadca050df8a847755000e4ac2dea90b785097589ab1f61d542439338
MD5 8e732efc9393fca75b82f77dfe8ec3ae
BLAKE2b-256 0e43fa15ca6b0092827401e8f2276350fc97a17e1955720e8f305392513618ab

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