Skip to main content

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

Project description

LogXide

Up to 2.7x 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 2.7x faster. Same code.

PyPI Python License: MIT CI

Installation

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

Performance

Real-world file logging benchmarks (Python 3.12, 100K iterations):

Scenario LogXide Picologging (C) ¹ stdlib logging vs Pico vs stdlib
Simple 446,135 ops/s 372,020 ops/s 157,220 ops/s +20% +184%
Structured 412,235 ops/s 357,193 ops/s 153,547 ops/s +15% +168%
Error 426,294 ops/s 361,053 ops/s 155,332 ops/s +18% +174%

¹ Picologging is Cython-based and only supports Python 3.12 or older (incompatible with 3.13+).

ℹ️ Benchmark Methodology Context:

  • Python Versions & GIL: Standard benchmarks are run across Python 3.12 and 3.14. Under Python 3.14, LogXide's basic handler tests (10K iterations) show a 1.8x to 6.0x speedup over stdlib handlers.
  • Caller-Info Introspection: Picologging synthetically inflates its throughput by skipping caller frame extraction (sys._getframe), which Python stdlib requires. LogXide performs safe, fully compatible frame introspection when needed, while still maintaining high performance.
  • For a complete analysis and detailed handler-by-handler metrics, see Full Benchmarks and Picologging Comparison.

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.19.tar.gz (272.1 kB 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.19-cp314-cp314-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.14Windows x86-64

logxide-0.1.19-cp314-cp314-macosx_11_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

logxide-0.1.19-cp314-cp314-macosx_10_12_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.14macOS 10.12+ x86-64

logxide-0.1.19-cp313-cp313-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.13Windows x86-64

logxide-0.1.19-cp313-cp313-macosx_11_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

logxide-0.1.19-cp313-cp313-macosx_10_12_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

logxide-0.1.19-cp312-cp312-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.12Windows x86-64

logxide-0.1.19-cp312-cp312-win32.whl (1.3 MB view details)

Uploaded CPython 3.12Windows x86

logxide-0.1.19-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

logxide-0.1.19-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl (1.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ s390x

logxide-0.1.19-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (2.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ppc64le

logxide-0.1.19-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl (1.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ i686

logxide-0.1.19-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARMv7l

logxide-0.1.19-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

logxide-0.1.19-cp312-cp312-macosx_11_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

logxide-0.1.19-cp312-cp312-macosx_10_12_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: logxide-0.1.19.tar.gz
  • Upload date:
  • Size: 272.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.13.3

File hashes

Hashes for logxide-0.1.19.tar.gz
Algorithm Hash digest
SHA256 cab43816b6190ccd5c349b41154a9e3e17d376a8d54bf5be304f03c68c97249c
MD5 cd1875ae801a32a12c7e79bb7f7ae668
BLAKE2b-256 6373f5d48102d997df7b8f03e807d8777d17eea13394b03d1f22873c50bef788

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.19-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 9c8a38ab2526001702f58974ad02866971bec4cd4f9d32ef616c302627f7dcdb
MD5 aa4abe2dd5d3ab7cacd92df6be005e28
BLAKE2b-256 4df8072fb6466d238666121604972b8253769d721a7d01af72d1e6d6f42e69ae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.19-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 04677e3dbf5e4a629ac3e414b3a41cf465a668401d27f0dd19ff3e2b5a1c1c90
MD5 1f49cff70a4e380cfb90310f9174ca64
BLAKE2b-256 068bafd4f877bb226fedbb93fbf1fc89b1280027a1d8f7d4df03197181b2eb60

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.19-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 06963a02086a2f718fcebc1064c44f031ea15e2362e9f3bb468e33dbb400f210
MD5 ea2ab38940f28ecb58ec0902dbd0560f
BLAKE2b-256 13c73e4841328c1030d85d70cc886e43789279598aaab12d8482a9341763ff70

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.19-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 ae3e974c66d10d52d81c67da1bc3d0361d15d5305aa70cfa7cd344be741f93ff
MD5 be7c7629f2767a323a841da0e86a42df
BLAKE2b-256 3dc39778f5801be89d9b085c7cf4e3c645e13bac8586aa08f456b041fe1794f7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.19-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5ffe235f40eaea27ed5325851d22ab2a91639c3796b9ac74f52a6b3907af2677
MD5 dc8d0ead01624c8ff36f44ea9f3bc094
BLAKE2b-256 a9ef709314f3d9a86f305561ff6c0a247087e2ac329976bb3939d0d995f73e52

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.19-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 904d19a4a861098fa8b5e54a4ba74d364af8da265153740d0db2af1d5d3c1353
MD5 1d6328fafd287492ef3394ac071cec24
BLAKE2b-256 1b0e9e61ac3715ef09564c79b52d6d7aae03f8aa2ac8aa0e65e0352654f6b6c5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.19-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e13c4447908692e7ea5d3e6193fde3d5a6d11c8b19aacbe62e6d108b23f0a3b2
MD5 67485980576382db1b2554f7dce2a8ee
BLAKE2b-256 d49c7502e7e8405b2bd38245363292d7d94f91c319790a3a3833cb2c36d98599

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for logxide-0.1.19-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 111ebda8a9b9b767cba21952bbea2b334bbe1f260b253c92947e45daba5a37cc
MD5 69853adb2fce49113c02dc29d6354c81
BLAKE2b-256 2de36fc048bb36df4fff9d3226d67be56e5e310dd88f8d381f37a80c5bca2503

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.19-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6cc576ed900397a940b229af92dbe4921d7d71dc475256b8998c7c7beea1e0c5
MD5 cb2a60a2c0e7e73876ec211206227850
BLAKE2b-256 de625f23672c2491b042d522855c90c630ff97a333dc4edfe84c3683a01e1e28

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.19-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 528be8e215779b3e3f9cc718f5eede403aa1bcbd7f4ff35bc328b4aaac219a2e
MD5 e745a371fd8e1048ea15178dd52206c4
BLAKE2b-256 d8ee282d1b134ad90e376db55b0a80a2ac6b6186af5f044e4527073e122b8d9c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.19-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 d2e774a1020ff727f2cda4f4dbabfd2fb37dbe2c497b2e346fcb25e581b29a55
MD5 ba5f19751e0b11639001a8460bc227ea
BLAKE2b-256 8601fba3396ff8f562fc7f94767d0970ebe9c63c868ec4cf162b76476b74124c

See more details on using hashes here.

File details

Details for the file logxide-0.1.19-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for logxide-0.1.19-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 ea2ff33811495c053b965bbc37ec3d3b0f4a241eab6807c381ec8cfdcf995c39
MD5 aeb5b02994e8d90046789324c23238f1
BLAKE2b-256 07e4abc5fe7f856495e438f3c44b26a67e2d8cda3efe6ba7c746282925c5babf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.19-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 62eaf703e22542d918176ec8ddaf3811361f295b7e3ba21c060b73f64c85e8bf
MD5 6535d9259511f6a1835b9d8494a347e5
BLAKE2b-256 b43f22792aece78dac4eda6c0f30f2c3a65dad6731056c33a859aff3c9751c96

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.19-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3d0eff7a367c5ac281250904210ca84f349cbe89866e3e69762d798e6613ff24
MD5 7763dde58e28162ac688a4250e9d24af
BLAKE2b-256 dc8aee28eecd387b8787360907868ae8d49e7f64f887e26a71879afd2e85f6c4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.19-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ca3c832a48d51df92dada6e3cd7cdebf7e1065e12169a8a75cd45dc6eb1cdbfb
MD5 eb5f9a9f0eb0af41ea6ca9dad728e81c
BLAKE2b-256 73bf4c446fb7940346b888ec167c983f0328ede519a7ecf936447ddc489f25d6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.19-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 3953d122e51444ad9803bd71ddefae5081c344046c4b45bba478ef82b5cfbafd
MD5 9a408046251b9b0eead0ab35129f3344
BLAKE2b-256 8a95015a7f441502beaadff0c1ee6e669dbcedc3fa708c6ac0831dd31ddd6b8d

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