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

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.14macOS 10.12+ x86-64

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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.12+ x86-64

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

Uploaded CPython 3.12Windows x86-64

logxide-0.1.8-cp312-cp312-win32.whl (1.7 MB view details)

Uploaded CPython 3.12Windows x86

logxide-0.1.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

logxide-0.1.8-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.8-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.8-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.8-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (2.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARMv7l

logxide-0.1.8-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.8-cp312-cp312-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

logxide-0.1.8-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.8.tar.gz.

File metadata

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

File hashes

Hashes for logxide-0.1.8.tar.gz
Algorithm Hash digest
SHA256 f8f6b0ae8990a550ebb20001316b7c00c40b52389bb642795a65e413a20cf216
MD5 58da81fabf491611dc777c8cb125e801
BLAKE2b-256 875b4ea781ee08506e4f26440eb8bf5f026ac5e69890ff79cb28c1c1b39a9d83

See more details on using hashes here.

File details

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

File metadata

  • Download URL: logxide-0.1.8-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.12.4

File hashes

Hashes for logxide-0.1.8-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 974ada3340082f9aae8f5a71601cf3b55a0055ed3a07339101fb46c31c1c2024
MD5 1e8b48a46c61590c11496023bab8fe6c
BLAKE2b-256 824400eb1e9212cb97eb267d18d1deb9940615d4b7df8ab9e1cb50e5b0be741e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.8-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f7ba7be2efd36847b6265c7fd7dba5d54d604681b1b16f6015e3bd94ef3317dd
MD5 8ec2925749a267f8a8c7cc5c40b8eef7
BLAKE2b-256 fc149aa0b8b921f91e0f1fa2d6170e9312d8512619a746b91e5e735174fbfe24

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.8-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8992858e64116d321006ee4df8371354556e9c7c6a316d96639d59e60dcf6180
MD5 7b2224ec222a6ec4aa72c52bb66a5529
BLAKE2b-256 ea647cdcd2daa1f2399178154529f31bdfe60bfc31b1f8118c919da2086a219b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: logxide-0.1.8-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.12.4

File hashes

Hashes for logxide-0.1.8-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 0bc59d115a3d28dca8af337f4f6286ab9f5dacc72ec3b83a9cbe41008d6f7939
MD5 e9c7700a9bd0fcccdef1965df5a71634
BLAKE2b-256 ce4105c594c4ef49193d5a0968aa8078ead33fea11a32e5ef9cd16943cbb2b69

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.8-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b93a8c26b42c8919d20a02a1ca4f59658a3f1a17bdecdf7ff5268314cf2c6d5d
MD5 ee19ca699a1d5589c9097797e8703b59
BLAKE2b-256 111d3f65e79da7e4396a53f777521544f7910cb5b6d5f694e0ea0a5fbc8ae4ad

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.8-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 533e08a949a40e3eb56ba21c4061af6a22d4199c19f6c6ff2b7c1b45f1e3d7a0
MD5 3e64db0620732ec735d9e1f0d05b5cb3
BLAKE2b-256 3779b13d4034f4995dc0f616138aceed247e8346259fc16fc4c67f1297e21c1a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: logxide-0.1.8-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.12.4

File hashes

Hashes for logxide-0.1.8-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6a3edd29efcb24b5dc969ec391e224f62f149f2559f2a99f934154117a60deb5
MD5 eb46d291084bb76c49493762224ae8f0
BLAKE2b-256 e783e74893cdf6208b5c36d448ff5bbbabd3bef3565e904d96f70b349d941f4b

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for logxide-0.1.8-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 2551ed37b14e8ed365d6816c5bdb63029770f9d404843262ee0eeae124165c67
MD5 41858af4d12381c48877fb130c9a5b1c
BLAKE2b-256 1343a1739b6c7ee7a0406ee29931b171054064dbf7be632c606e3474ef044beb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5f20bd8577d233c891a960abc36452384124bea698580e67d5f07e44693dc4c9
MD5 3562f23716a17161c109a5831f12df42
BLAKE2b-256 66fcaeec36b9900ddbe10c419ac1f39fb477452befcfb27957b50a4cebc4d864

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.8-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 c4be0fb9c436a17769497c41d61ac1f3d7e39dc59110419d587f7eab24458f5b
MD5 dbb20194f4ff7834c291bc7bab0a5953
BLAKE2b-256 3455fad2a803a0dd02c4ecdf1827b97bc034aa1e172e4b3d291dea652c538862

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.8-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 0c96544195a82a0babf95896580f4c07f62e04d05437b63acba0767325584a23
MD5 b661d511351d0c1b6744857c8fe0b262
BLAKE2b-256 89f7479f28f26ae75c8793b2b27046e8874cc88b8f371ece54bbae6935484bbb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.8-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 981f3703a530c474cacab6d3b92d257e8bfcac16e56148d07e7ac3fcbcad59c5
MD5 6af2e3209392d05efc70cb5a6698b603
BLAKE2b-256 0ab8b1eab3998b7a3e3cdc6326a43e9d891dae720fedc64fd305954836c1cd7a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.8-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 872de5808b2b29e78502c301463484def0779ad06377b4ff1fb3da7be9946753
MD5 2fdc1ce3be2e514607a897f101e7f779
BLAKE2b-256 35183ee684db156aad4e6a8af7bfebdeb61d603312ff50658cecd82157d43305

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.8-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3bd3d07afa76f92ef3ed57d85c9b4e5760a63d7efe356f3d27233959131490fb
MD5 57d362f716e66587682102402155f3dd
BLAKE2b-256 52bcc2939c0c0799e7beb98f253cee38f2d9d55a65431c151b23f2c938d8ec5f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.8-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0065dbd9206b51d5fe8446a3fa9db35ebbe395a322722f6a340012782b54b76a
MD5 d47b879088343ed85b9d330131438a11
BLAKE2b-256 5ab0f20670edc853d18f69aa597c07e2cbaf1e3d3325e93fdfee280777902332

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.8-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 39d0f5f70aa7c11fc135d14126dcda1db5f89387888f8ded0ad045f70ceff157
MD5 7ac8d0f66105fa0c53be58f462b8c6ec
BLAKE2b-256 368c375d5030bcb9a180d189ba6817c2a4058a8790119daca9292706e16e7811

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