celery-logger is a python library for logging celery events such as tasks received, tasks failed/succeeded and tasks retried, along with task args.
- Simple and flexible task logs
- Multiple deployment options (docker, virtual machines)
- Integration possibilities: ELK stack and AWS cloudwatch for example
Celery-logger connects with your message broker (such as redis, rabbitMQ or SQS) and logs the tasks on a file or stdout.
This way you can easily have multiple celery workers and see your logs in a single place.
We provided a sample project for playing around and seeing how it works.
# navigate to the sample-project folder
$ cd sample-project
# Build and start the containers:
$ docker-compose up
Make sure you are in the sample-project folder
$ docker-compose exec celeryd python call_tasks.py
Tasks have been called!
Run `docker-compose logs -f celery-logger` to see the logger in action.
$ docker-compose logs celery-logger
$ docker-compose logs celery-logger | grep task-failed
$ docker-compose logs celery-logger | grep "app.add"
$ docker-compose logs celery-logger | grep "app.add" | grep "(6, 1)"
$ docker-compose logs celery-logger | grep 20925a8c-03f7-4bd7-b3dd-24e2bc9e26e2
Use the package manager pip to install celery-logger.
pip install celerylogger
Or go with the docker way: https://hub.docker.com/r/cravefood/celery-logger
The executable will be available in the path as celery-logger
:
# Display the help text
$ celery-logger -h
# Start logging from a redis broker
$ celery-logger --celery-broker redis://redis:6379/0
- Sergio Oliveira - Initial work - Seocam
- Thiago Ferreira - Improvements, documentation and current maintainer - thiagoferreiraw
- André Girol - Packaging and distribution - Girol