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

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.14macOS 10.12+ x86-64

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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.12+ x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12Windows x86

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

Uploaded CPython 3.12macOS 11.0+ ARM64

logxide-0.1.9-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.9.tar.gz.

File metadata

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

File hashes

Hashes for logxide-0.1.9.tar.gz
Algorithm Hash digest
SHA256 533025963f7c1c16a50c561bb9b55738a51d3d5c556d87c338ec4dadf0c70fd6
MD5 69539ebe1ea54e0ef8c6f5f8fab1cdb2
BLAKE2b-256 7251fe84aab25c9b32fe6d39f76a3aee890ebad9d72092d6fdad8ea67a05917b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: logxide-0.1.9-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.9-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 cd79cf70826cfa24bf7ce9cbad583a958343e7ba4c7b1cc807e62ff37a2c596f
MD5 721d94ce9fab76d2d899556add5fd29e
BLAKE2b-256 927fa1f96f20a20f3d2db40c71d7b284b0336a0661d1b86d452c97791e89c60e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.9-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 88451139781cb6f167278ddd53877c6bb24b46f82d595a1ba269923752755ec9
MD5 408fe6fff47fbeda43156005fa7b07a1
BLAKE2b-256 0ff3f84711b7e74ea25279470454e2170823b1fd280e52bea9296de63f240770

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.9-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 51a947b5b19b7524accc42ae9ce873b92306304ce09ac72dc110ffff22a3626b
MD5 af4e06a7099d2abd53cbb89a84ddfa65
BLAKE2b-256 bcab3b429ce25f020479236fa4a03c84a9972dcba849fe6c36b1bff2e4d2a6bd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: logxide-0.1.9-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.9-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 177383ac9a345f8f499190fb32b3382d8e85b21427b1e34d9b0f5018b4fef2d6
MD5 c502d0cc726ee2211d17acb1238640a1
BLAKE2b-256 fee1278a5edf71f4c31e8cbc36bb801916561aa041c7af05e6949f4732698bf9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.9-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6aeeac95dfaa332aaf6f7d88f3341e09583b2b2a4230b91bf61f7c56c8daf2af
MD5 4abb964cd57cd11b95115e3bb61840df
BLAKE2b-256 2ff5200bf3f88efb233f9e2bf8de3f62ec769a848dfc8dc1e40aa87814c5b2eb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.9-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 cdf24d50fde5a381a26808f95c2bd2036fcd41617b4d58877ede031f5ede9303
MD5 89c927364d9641b40a2d2b074a88f4ee
BLAKE2b-256 8cfabd82fd4222f56e6f8b796a8725a5dc354b6a7d042f9b7ebf0276125976f3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: logxide-0.1.9-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.9-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 24b912597edbfd88b5fd4880cdaaab60663b19a69b12c0306bbbd3c2b8c5fef7
MD5 b65d1832a29ab9085ac76c8e2acdb27a
BLAKE2b-256 848ac9071767fdedc297d5112733bd13331ac5297fb5a5933d38517656a6e9fe

See more details on using hashes here.

File details

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

File metadata

  • Download URL: logxide-0.1.9-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.9-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 975b257fc40db8bd74bac523372443f9013cc63fe5f7e5ef75d9b8fd67f36c32
MD5 9f9f608bdbcf76f6469a87ba656fa917
BLAKE2b-256 681e1e0a774d9e30a71f0b4ec5a3524618845f9b4f337dcf92bb1501b634703f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.9-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b46f431843ee22513c62a745245162bb90a06e71c8919dfdf8ce4940f099779e
MD5 3fee6e77f0b02f6365b2f62438068646
BLAKE2b-256 13fa584aea6bab6e4b27bf736a600660e4cbf4017f00fd2713b9923beceb5a84

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.9-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 1e116ea81a8881a0f22be8112fbf8d082a399ec17d0432690b688cddff2f41d6
MD5 f217e57f9b571f728626e61d6be650c6
BLAKE2b-256 0f0461c35baf73a1d4300f156ce67e8e96a72a93f46773d9edce29090d596c2a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.9-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 f7cf2b4f4f8ffb2b95718d081b4598b55facdc740beb568cce487c98a045af8a
MD5 5b963590a9743f20eb851d19191f74df
BLAKE2b-256 a2f4d08397f96fd8cb5a47f905a856b96ae0d03ea0678471845586a91f86c1cf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.9-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 d73b810f8aabfe66a1596ab4645c4a38da4220f868dc3310990cf379490648e6
MD5 ba2c4cff8e25c9d8e3aa4f89bdc03947
BLAKE2b-256 587dbfca67e9c0f550ba3b4e3b9f10ca0b4be9521472521967a33ab1b55492f3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.9-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 92140f9e94da829dce76859c7e4e5fef4f98c8b8eb765d3471ef9e50f5cc94a7
MD5 542d41ec2828285d029275fc66fe1317
BLAKE2b-256 b773569c17c3a65d13aee9ff4f2cb94fbe6eda357d534d339a1eb444b618fdaf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.9-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 837968261c2c4dc501e4f7ebdfa8fed999b5968adc6d3c4a80142db830e0acb8
MD5 83d0a7b5b14dbdd711e3a06c8fc3cf32
BLAKE2b-256 b58af60fd12b81a5e204eed4b4f71d391c6e693d42c388df496bd878513bab2c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.9-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 329c9743a8e4a9c60e33513fbd0349bbe43ce5262ee4d4a08199c98a870477ca
MD5 f6668be7a4173b91543bd7d562dd8750
BLAKE2b-256 f0257d7e58ac20bf3c0855b8b80145a121a7502709e044c5248a28c7bd0d4017

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.9-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ef5b93eed22b5035c740754ed5c080e6bd080fda7a9812cc48d529d4a336f9a3
MD5 f0526a60c462af0ca9bb02e8fa312ddb
BLAKE2b-256 30bef5663ee048b67cb593db0acc59ac1ea084b7e149ce0aad7c58178cb9c8ba

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