Registry / observability / aiologger

aiologger

JSON →
library0.7.0pypypi✓ verified 84d ago

Asynchronous logging library for Python and asyncio. Version 0.7.0. Supports Python >=3.7. Provides an async-compatible logger that integrates with the standard logging module. Release cadence is low; last release was in 2021.

pip install aiologger
INSTALL
IMPORT
SIG · AIOLOGGER
A
aiologger
observabilitypythonv0.7.0
Install
2.4s avg
Import
215ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.7.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.224s · 19.6MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.4s · import 0.206s · 20MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Logger
from aiologger import Logger
AsyncLogger
from aiologger.loggers.json import JsonLogger
from aiologger import AsyncLogger
There is no AsyncLogger; use Logger or JsonLogger.
JsonLogger
from aiologger.loggers.json import JsonLogger

Basic async logging with default handlers. Always call shutdown to flush and close handlers.

import asyncio from aiologger import Logger async def main(): logger = Logger.with_default_handlers(name='my-app') await logger.info('Hello, world!') await logger.shutdown() asyncio.run(main())
Debug
Known issues
gotchaLogger is a coroutine-based object; you must await all logging methods (info, error, etc.) or use asyncio.run. Not awaiting will produce warnings or silently skip logs.
fix
Always use `await` when calling logger methods, or use `await logger.info(...)`.
affects: all
gotchaLogger's handlers are not static; you must call `shutdown()` to flush and close handlers properly. Failure to do so may lose final log entries.
fix
Always call `await logger.shutdown()` at the end of your async block.
affects: all
deprecatedThe `aiologger.AsyncLogger` class is misdocumented; the correct logger is `aiologger.Logger`. Some older examples reference `AsyncLogger` which does not exist.
fix
Use `from aiologger import Logger` instead.
affects: 0.6.0 - 0.7.0
Errors
Common errors & fixes
RuntimeError: Task <Task pending ...> got Future <Future pending ...> attached to a different loop
Creating a Logger before the event loop is running, or mixing loops across threads/contexts.
fix
Ensure all aiologger calls happen within the same event loop, typically the main thread's loop. Create the logger inside async context.
TypeError: object dict can't be used in 'await' expression
Trying to use `logger.info` as a synchronous call without `await`.
fix
Add `await`: `await logger.info(...)`
Upgrade
Version history
0.7.0latest on PyPI · released Oct 5, 2022
Audit
Dependencies

No dependency data recorded yet.

Agent activity
57 hits · last 30 days
node
48
OpenAI (training)
1
Resources
aiologger — pip install aiologger · libregistry