Skip to content

Comparison

Logly is a high-performance logging library with a Rust-native engine. It provides a clean Python API with built-in levels, flexible sinks, rotation, compression, structured output, and framework integrations.

Feature Matrix

CapabilityLoglyOther Python APIstructlogstdlib logging
EngineRust (PyO3)Pure PythonPure PythonPure Python
10 built-in levelsYesPartialNoNo
Custom levelsYesYesNoManual
Multiple sinksYesYesNoYes
JSON serializationYesYesYesFormatter dependent
Pretty JSONYesCustom formatterYesFormatter dependent
Custom format stringsYesYesNoFormatter dependent
Callable formattingYesYesProcessor basedFormatter based
Level filteringYesYesNoYes
Callable filteringYesYesProcessor basedFilter based
Context bindingYesYesYesAdapter based
Scoped contextYesYesContextvars processorsNo
Record patchingYesYesProcessor basedNo
Exception catchingYesYesNoNo
File rotationYesYesNoHandler dependent
RetentionYesYesNoHandler dependent
CompressionYesYesNoHandler dependent
Background workersYesYesNoQueueHandler
HTTP loggingYesCustom sinkNoNo
TCP/UDP loggingYesCustom sinkNoSocketHandler
SyslogYesCustom sinkNoSysLogHandler
FastAPI integrationYesCommunity/manualNoNo
Django integrationYesCommunity/manualNoDictConfig
Flask integrationYesCommunity/manualNoManual
Rich consoleYesYesNoManual
OpenTelemetryYesCustom sinkProcessor basedManual
PrometheusYesCustom sinkNoManual
Pydantic configYesNoNoNo
Type stubsYesPartialYesNo
Zero unsafe RustYesN/AN/AN/A

Migration Pattern

Start by configuring sinks explicitly at startup, then pass logger or independent Logger() instances into the components that need logging.

Migrating From Other Logging Libraries

Most day-to-day calls are intentionally familiar:

python
from logly import logger

logger.add("app.log", rotation="10 MB", retention="7 days", compression="gzip")
logger.bind(request_id="req-123").info("request accepted")

Use Logger() for independent sink sets:

python
from logly import Logger

api_logger = Logger()
worker_logger = Logger()

api_logger.add("api.log")
worker_logger.add("worker.log")

Released under the MIT License.