Skip to main content

Asynchronous log for python logging.

Project description


Build Status Coverage Status

asynclog provide the asynchronous way for python logging. Leave the logging I/O(especially the network I/O when we want to logging to a network endpoint) to the asynchronous thread or asynchronous task provided by celery .


  • Python 3.5+


python install


  • Using thread
import logging
import time

from asynclog import AsyncLogDispatcher

def write_log(msg):
    # Do write stuff, such as write log msg into network.
    # ...

logger = logging.getLogger()
handler = AsyncLogDispatcher(write_log)
logger.addHandler(handler)'Test Log')
  • Using Celery
from celery import shared_task

def write_task(msg):
    # Write log in Network IO

celery_handler = AsyncLogDispatcher(write_task, use_thread=False, use_celery=True)
logger.addHandler(celery_handler)'Test Log')


python -m unittest
Ran 4 tests in 0.003s


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for asynclog, version 0.1.4
Filename, size File type Python version Upload date Hashes
Filename, size asynclog-0.1.4-py3-none-any.whl (5.2 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size asynclog-0.1.4.tar.gz (4.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page