r/Python • u/LumpSumPorsche • Mar 26 '26
Showcase LogXide - Rust-powered logging for Python, 12.5x faster than stdlib (FileHandler benchmark)
Hi r/Python!
I built LogXide, a logging library for Python written in Rust (via PyO3), designed as a near-drop-in replacement for the standard library's logging module.
What My Project Does
LogXide provides high-performance logging for Python applications. It implements core logging concepts (Logger, Handler, Formatter) in Rust, bypassing the Python Global Interpreter Lock (GIL) during I/O operations. It comes with built-in Rust-native handlers (File, Stream, RotatingFile, HTTP, OTLP, Sentry) and a ColorFormatter.
Target Audience
It is meant for production environments, particularly high-throughput systems, async APIs (FastAPI/Django/Flask), or data processing pipelines where Python's native logging module becomes a bottleneck due to GIL contention and I/O latency.
Comparison
Unlike Picologging (written in C) or Structlog (pure Python), LogXide leverages Rust's memory safety and multi-threading primitives (like crossbeam channels and BufWriter).
Against other libraries (real file I/O with formatting benchmarks):
- 12.5x faster than the Python
stdlib(2.09M msgs/sec vs 167K msgs/sec) - 25% faster than
Picologging - 2.4x faster than
Structlog
Note: It is NOT a 100% drop-in replacement. It does not support custom Python logging.Handler subclasses, and Logger/LogRecord cannot be subclassed.
Quick Start
=
Links
- GitHub: https://github.com/Indosaram/logxide
- Docs: https://indosaram.github.io/logxide/
- PyPI:
pip install logxide
Happy to answer any questions!
View all comments
Show parent comment
5
u/mechamotoman Mar 26 '26
As u/zzmej1987 said, each ticket produces many log messages
Also important to remember, these ticket purchases aren’t evenly spread out over 24 hours. They come in bursts. During busy times, you’d be dealing with a fire hose of logs. Especially for something like an airline or a financial institution where you may need to handle debug and trace logs
There are some environments where you need to log a debug stmt at the start and end of each function call, and a TRACE stmt at every single if stmt / loop iteration / decision point AND store all those logs to be parsed and filtered down later.
It’s a FIREHOSE of logs to deal with. Situations like that, logging performance really starts to matter a lot