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

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.14macOS 10.12+ x86-64

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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.12+ x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12Windows x86

logxide-0.1.7-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.7-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl (2.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ s390x

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

File metadata

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

File hashes

Hashes for logxide-0.1.7.tar.gz
Algorithm Hash digest
SHA256 dfe3ed0dd94f3c3719cf2f650c3454014fdb147dba591f8ad22d09c63daffb81
MD5 fcba6d2c6516a2b65d75bea1070fcc69
BLAKE2b-256 e997e089eef7ee76bf09f23a835042812b9fea6c62aeb503b6888bcbe1d8ce1b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: logxide-0.1.7-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.7-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 bcf85fd4e87f672f3b2f1273e5fad9bac9601b7ac3722e36da3da7df8efe0247
MD5 532665e63dce47ccfc52d1776293a6b8
BLAKE2b-256 b5663f15e8478a2aefc8abceb41487feaf0ad12e73172683363d6c98146da8e2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.7-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ebe03e6313fa39704d57982bbd05641ee6aad9ec2eff83ef0fc8a2ee40a99a66
MD5 519476430d4a0fb3e01c356054b3da66
BLAKE2b-256 58f9415e6ead9d36190e3a6793ee3b7fb62e51e428d59a5f49fbb6951cedf87a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.7-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 bab869df3a783b1858c72d8fa8e586ddbcbd23fe734d98dfbbf9f10eb4ef4cb3
MD5 02124bc01331ed9df9dc67149c15515e
BLAKE2b-256 d0eeb6309173219d129c3ef256286edf54cf8463237a6e329877f18e653f8fd5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: logxide-0.1.7-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.7-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 15129bb3937c93e64b31bf7b9e729f6bc5a4b8c1eff7d562040ca97856e61d6e
MD5 9cc0c2de67677b6d5b0698dee56b599d
BLAKE2b-256 1220e2381556f4ddce6bf4f044e83cc766c35728f3e6c7cb12c3e8bdee9e9db0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.7-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1715494d130af847ceea4bc61a96642a6ca8515a6414b0b4a6851963d4e0851b
MD5 b5c2cacc42ceb52d9410e1ad7ed27740
BLAKE2b-256 db097b4ee0a3e07c95792cdb12116919bdebedf8acc872a29107768c3f462cae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.7-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 da4b4b0669fa085953e07107e78d79fdbf32989b578cb61d9f3de8f60b0682ce
MD5 9103122accdea433e70a583a7ccc820c
BLAKE2b-256 7b3fc962a19eed9b5c207826f666272fc8b7714bc6ffc332424c7b60d855ccb2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: logxide-0.1.7-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.7-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 75bab65aa9dd95e11446ad174133001dc0f9f2cf54ed9318eb18731141db44c9
MD5 7ba5ddc0bf5628a5662fd1317c01fd87
BLAKE2b-256 815310eed2a83781081a0b3bc8d33df3c6d4f8062f35f4741229646248c25625

See more details on using hashes here.

File details

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

File metadata

  • Download URL: logxide-0.1.7-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.7-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 03550d085b9a73fece7cfb6a6b246d00c67e466c493f0a4cfd59c8af925c54cc
MD5 e57aa7c25ece5e80a752d7c43b73a77f
BLAKE2b-256 91e4b35d6ea865cd201c0054f1b24caa195f2d4287c06c0082f0783755c56a19

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0586ff424e6a1839e4d27bb12f309b2e60acc174006e25311e5d3f7223874351
MD5 ae1164019b7b4cb9578bc59c91da415f
BLAKE2b-256 850b524c5feee55f84b8bbb69786eb35b9438198b86d2638cfd927ecf35c05ef

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.7-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 b435e9875341b63c59a9f0d6c411796cae13f6185214d9988092a0e53c599988
MD5 3e85cfecf4e1601496fc478ba753a73d
BLAKE2b-256 e64c636ece59f69e8ea0f0b6689c2e3a7a1fb879b517f59cdb7a626fc4d05007

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.7-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 5dc470c1f110e78f3535dab079c8c0c62a86b1fc1db39459aa548f94ec05f93a
MD5 50dc6194acaeb9a7773a975ee37fa929
BLAKE2b-256 8a705d02bf4302ce7a903a60ae3f082eac45d068a3e4849226a99b608b3cb2fb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.7-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 8c62378382dce8fc572cfd01e33ea751b955f7bde1741c6a3e8c06a611c607f7
MD5 f44c51d4213afcf6f06bdfe154f8e145
BLAKE2b-256 97f8e21dd15993b4f2ccc30e6ff8a36620e91c5f6690371efb1642beda2f1a48

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.7-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 aef4ea27fbb25993491ea83e5c8dc19fd1a23ad0c9ca51f45e2560ed7b48cfc0
MD5 4b49a90c3fda02ce92fa08dee73f4513
BLAKE2b-256 be75883061ab77a460312aebca2c52ee03acdcb15de17a3c8ab5eedd859ebdd5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.7-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4e7daf01f5f39df06ef108785b8052be34cd687ce87c0e19eb491c4d0f7778a0
MD5 38fc9c5881a835cf7113329a9d863261
BLAKE2b-256 86d3cdefb345263a459f74992d1fc65de12caa6622136707b0a5e39f251cedd2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.7-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b547af461396cd57ae58658fe7cdb82bf80fd550d8189baaae1e37ebb9c64e1f
MD5 92706454fa6aa4397468e972b6175722
BLAKE2b-256 664bd1494f12a6df0131a1faa5a64b9eb2a1b43d8ab425a026404a057e0092f7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logxide-0.1.7-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b62b42daa82e1c5c3ac056dda07df6c00e13960a38851f5bf1b0f6568c90dfc8
MD5 31377ee39d423ee5ce92497a3347ec0e
BLAKE2b-256 59c2a8f60768ea84d5f5d0f9df7442da24543c5185fadd491e973bf2dc2e4fbc

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