Skip to main content

High-performance, Rust-powered drop-in replacement for Python's logging module

Project description

LogXide

High-Performance Rust-Powered Logging for Python

LogXide is a high-performance logging library for Python, delivering exceptional performance through its native Rust implementation. It provides a familiar logging API but prioritizes performance over full compatibility.

Key Features

  • High Performance: Rust-powered logging with exceptional throughput
  • Familiar API: Similar to Python's logging module (not a drop-in replacement)
  • Thread-Safe: Complete support for multi-threaded applications
  • Direct Processing: Efficient log message processing with native Rust handlers
  • Rich Formatting: All Python logging format specifiers with advanced features
  • Level Filtering: Hierarchical logger levels with inheritance
  • Sentry Integration: Automatic error tracking with Sentry (optional)

⚠️ Important: Not a Drop-in Replacement

LogXide is NOT a drop-in replacement for Python's logging module. It prioritizes performance over compatibility:

Feature Status Notes
Basic logging API getLogger, info, debug, etc.
Formatters PercentStyle, StrFormatStyle, StringTemplateStyle
Rust handlers FileHandler, StreamHandler, RotatingFileHandler, HTTPHandler, OTLPHandler
Custom Python handlers Not supported - use Rust handlers only
Subclassing LogRecord Rust type, not subclassable
Subclassing Logger Rust type, not subclassable
pytest caplog Not compatible
StringIO capture Use file-based logging

If your project requires:

  • Subclassing LogRecord or Logger
  • Custom Python handlers
  • pytest caplog fixture
  • Full stdlib logging compatibility

→ Use standard Python logging instead.

Quick Start

from logxide import logging

logging.basicConfig(
    level=logging.INFO,
    format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
)

logger = logging.getLogger('myapp')
logger.info('Hello from LogXide!')

LogXide automatically installs itself when imported.

Installation

# Basic installation
pip install logxide

# With Sentry integration
pip install logxide[sentry]

# Development dependencies
pip install logxide[dev]

📘 Usage Guide - Common mistakes, correct patterns, and troubleshooting

Documentation

Sentry Integration

LogXide includes optional Sentry integration for automatic error tracking:

# Configure Sentry first
import sentry_sdk
sentry_sdk.init(dsn="your-sentry-dsn")

# Import LogXide - Sentry integration is automatic!
from logxide import logging

logger = logging.getLogger(__name__)
logger.warning("This will appear in Sentry")
logger.error("This error will be tracked")

Features:

  • Automatic detection of Sentry configuration
  • Level filtering (WARNING and above sent to Sentry)
  • Rich context including stack traces and custom data
  • Zero configuration required

Performance

LogXide delivers exceptional performance through its Rust-powered native architecture. See our comprehensive benchmarks for detailed performance analysis.

Python 3.12 Benchmark Results (File I/O)

Real-world file logging performance (100,000 iterations):

Test Scenario LogXide Picologging Python logging vs Pico vs Stdlib
Simple Logging 446,135 ops/sec 372,020 ops/sec 157,220 ops/sec +20% +184%
Structured Logging 412,235 ops/sec 357,193 ops/sec 153,547 ops/sec +15% +168%
Error Logging 426,294 ops/sec 361,053 ops/sec 155,332 ops/sec +18% +174%

Key highlights:

  • 15-20% faster than Picologging (C-based) in production file I/O scenarios
  • 2.7x faster than standard Python logging - upgrade with zero code changes!
  • 2.5x faster than Structlog across all tests
  • Native Rust I/O provides measurable performance advantages
  • Consistent performance across all logging patterns

Limitations

LogXide uses Rust-native handlers only for maximum performance:

  • Rust handlers only: FileHandler, StreamHandler, RotatingFileHandler, HTTPHandler, OTLPHandler
  • No custom Python handlers: logger.addHandler() rejects Python logging.Handler subclasses
  • No subclassing: LogRecord, Logger are Rust types (not subclassable)
  • No StringIO capture: Use file-based logging for tests
  • No pytest caplog: Not compatible with Rust native architecture

Alternatives to LogRecord Subclassing

Instead of subclassing LogRecord, use these approaches:

Use Case Alternative
Add custom fields Use extra parameter: logger.info("msg", extra={"user_id": 123})
Add metadata to all logs Use global_context in HTTPHandler
Transform log output Use transform_callback in HTTPHandler
Dynamic context per batch Use context_provider in HTTPHandler

Example - Adding custom fields:

from logxide import logging

logger = logging.getLogger('myapp')

# Use extra parameter (supports complex types: int, dict, list)
logger.info("User logged in", extra={
    "user_id": 12345,
    "ip": "192.168.1.1",
    "metadata": {"browser": "Chrome", "version": 120}
})

Example - Global context for all logs:

from logxide import HTTPHandler

handler = HTTPHandler(
    url="https://logs.example.com",
    global_context={
        "application": "myapp",
        "environment": "production",
        "version": "1.2.3"
    }
)

Example - Custom JSON transformation:

handler = HTTPHandler(
    url="https://logs.example.com",
    transform_callback=lambda records: {
        "logs": [{"msg": r["msg"], "level": r["levelname"]} for r in records],
        "meta": {"count": len(records)}
    }
)

Example - OpenTelemetry OTLP (Protobuf):

from logxide import OTLPHandler

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

Compatibility

  • Python: 3.12+ (3.14 supported)
  • Platforms: macOS, Linux, Windows
  • Dependencies: None (Rust compiled into native extension)

Third-party Library Compatibility

Library Compatible Notes
Flask Works with app.logger
Django Works with Django logging
FastAPI Works with Uvicorn
pytest ⚠️ caplog not supported, use file-based testing
Sentry Auto-integration supported
structlog Requires custom handlers
infra_basement Requires LogRecord subclassing

Contributing

We welcome contributions! See our development guide for details.

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

License

[Add your license information here]


LogXide delivers high performance for applications that don't need full logging compatibility.

Built with Rust for high-performance Python applications.

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.12.tar.gz (224.6 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.12-cp314-cp314-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.14Windows x86-64

logxide-0.1.12-cp314-cp314-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

logxide-0.1.12-cp314-cp314-macosx_10_12_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.14macOS 10.12+ x86-64

logxide-0.1.12-cp313-cp313-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.13Windows x86-64

logxide-0.1.12-cp313-cp313-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

logxide-0.1.12-cp313-cp313-macosx_10_12_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

logxide-0.1.12-cp312-cp312-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.12Windows x86-64

logxide-0.1.12-cp312-cp312-win32.whl (1.8 MB view details)

Uploaded CPython 3.12Windows x86

logxide-0.1.12-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

logxide-0.1.12-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl (2.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ s390x

logxide-0.1.12-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (2.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ppc64le

logxide-0.1.12-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl (2.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ i686

logxide-0.1.12-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (2.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARMv7l

logxide-0.1.12-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

logxide-0.1.12-cp312-cp312-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

logxide-0.1.12-cp312-cp312-macosx_10_12_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for logxide-0.1.12.tar.gz
Algorithm Hash digest
SHA256 197ef079fdf4d272166702856d1059429b6d2ddb4341edeb39b1b65004d4b345
MD5 0172b5909c6e7b57ba34b539bec885dc
BLAKE2b-256 e7f37b88ba9992138cf8b6b24743a0ba6f078daa0564316ba4f918777d2c0e7f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.12-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 e3378ea6bd1e7df5fe4b57d53ab475fcf5869ef8bfb969716ed35522672f865f
MD5 643fdc65cc05a6b6595d1151a1be2519
BLAKE2b-256 6ca8bb098a0737a9baeacf492c9dc67681179cde8cd507a97d9de9f6c496d190

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.12-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d44ff7e637f9dba5b661f3f90c84d3bbd24ff0a65a07f3386e9711c445b5053f
MD5 de1097e623262033a59cf53f37acd158
BLAKE2b-256 d54c967069b2d447ea1ec55089bd52e849a81fe9ca8a2dafde3033743e954670

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.12-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a6640260a6b6a9e6ba63bc835f72c03c429d26fb842a4e9f36813af3e722d58b
MD5 212ceb9b22cd49683e73262713cfaccb
BLAKE2b-256 a05f830d9d545d7c2d72369a8d5764cbfc27c1524974ab74c38f6c4ea2a218bd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.12-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 5144fa08897fa2e1f26e63af2ad8cf41ac4a1c2440619b6d95c2f5678709237b
MD5 5249a9952d223824f62abbd0c87caf48
BLAKE2b-256 ef5a82149acc005c7b798b2f6680ce3390935b8a36f39fde4b369dd3e91c4451

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.12-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cbc38857c5cf44549c46581e129d2c05cbe7d1e227cb04ee925f8a08c85e9339
MD5 81f5abdb852849ebecd77d6330bb3f0c
BLAKE2b-256 f6e60ce65395a9f89be74a1df83f1b76d3e2212aa86cc42dade2fc5e133b371c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.12-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 64312b0008cffccd19df92b8b48d9e8571581cfd73ca90ab6519e8799896d673
MD5 2841b8c550a0c6f9f3d63d4b22dd8a9e
BLAKE2b-256 f19a7923a9bf4840b5d0f004cae45154ead2b337227d8d918cc7af36f2e92e13

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.12-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7e0cfd0cbd67f74df5532f11c6296b4bc66428602bbed11b9efa6e0eec430c96
MD5 6a3dbdf863c0582287b73baf2b39eefc
BLAKE2b-256 733ec04c2981c5cbbadce7e4601c76bdda6e9748f501cd604e9fa10f79ba36e5

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for logxide-0.1.12-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 704444cdb1af57faa66ff100cb4e623a94e8d50b0816b76b04abb7b272c80e26
MD5 c8c46c280e98d8561b789a5272c7603c
BLAKE2b-256 47c4d90d57a976ff36f2d05950748e1b53526cd43ce7ce218766fd194bee626d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.12-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 821b630e6d1521822f8843ebe97d2bed55f7c795d5691f832b79cadbb05979d5
MD5 44c2957ebb2bd12a14957f224ffc7f27
BLAKE2b-256 6551449d4d716fff1f79288d7342c50c49ea36517fb862492587628e047fc251

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.12-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 174beb1ab2a054bc6fc3ea9feea3b856bd907c30cc54bfdd3c117ed6213a1ad8
MD5 7161b84ea223f4d34f17b688c34c4039
BLAKE2b-256 b8086490e61c805724eae6e2324423d03fe4d38ee8bb39d099848de259cd24af

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.12-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 91e1ce9567126d11ac87b51f043fdb0249dfdf7f6cc48e20e73f65cb8196947b
MD5 a75cc858753ab8ca9d6d2b7101c92d72
BLAKE2b-256 74209ad56cf8205bf0f32c358b913fdc94027b6d4c82f03a3dfecfe4ab0b6089

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.12-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 0311081212caf59cde9903c0b5301bdc1a91a85ec70ed25589423ea357cd0698
MD5 b42f2c76d665348dabe62e16fc6f0d8b
BLAKE2b-256 d55d5d3c60f083e2c6fba7427a09327098547136569544818cc8d71ad6b78e1f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.12-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 9175df1dcacbde9702f4debb15137bfadf46661faa1ffb0d47310de1c4ed65ac
MD5 989b370fedfdfc64eb5c3bc24a53075e
BLAKE2b-256 424a0c52f373b58036489d8415d9ff061725248c2c14a2c512ef06680da4ee40

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.12-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 d041586daaaadd621ede80c8ca16c026339159715c61959956752920b6a1c32e
MD5 942655fd2da1cbcc3d68ee0e0afefcaa
BLAKE2b-256 fd28fba5ff5a3606172b9594aa25cc8948a4090ce92e3c1dd2123cc3ef68c2dd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.12-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 59ce5c3865ff6e8b62ec5b650a85fada99236b48ca71b034e81be094ffa384ba
MD5 ca460c156d10347b328a1036c1f4e8e9
BLAKE2b-256 5ec7e42b44248629cfd4f9dcabf400e54fcd77b24eaaae50180a2e7fd99b3392

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.12-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f0e4d79ca4c61bce465d4469b11b2c12b57637906e450172d51042b744064008
MD5 d37b579ec69a6aa89c0a18d420965e0e
BLAKE2b-256 fb9801f451d774d6676d17b6dee9fd70f687200554a623191f4c3d9a314dd822

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