W
W
wawa2018-07-14 12:07:52
Django
wawa, 2018-07-14 12:07:52

So how does logging work in celery and how do you set it up?

From what I understand:
1. Celery adds two loggers to standard Python logging - celery and celery.task.
2. celery.task does NOT pass logs up to celery.
3. Function celery.utils.log.get_task_logger(name) creates a logger bound to celery.task.
Questions:
1. Why does get_task_logger('some_name').name return 'some_name' and not celery.task.some_name? After all, the hierarchy of loggers is defined in the same way. In the python docks, it is recommended to do this (via __name__ for convenient creation of a hierarchy).
2. Logger celery - for everything that is going on in celery? How then does it work if there are several workers, these are different processes?
3. Is the celery.task logger also common to everyone or does each worker have its own?
4. How do you set up celery.task?
5. Why is worker_hijack_root_logger needed? Why would celery drop the main logger at all?
6. Why is this worker_redirect_stdouts at all? Why redirect std to logger? Is celery stuffed with prints? Normally, the opposite is done: a logger is used in the code, and then, if necessary, the necessary handler is hung up (if you want - in std, if you want - in a file) 7.
Signals also come into play here, which makes it even more "fun"
setting up celery logging with your django project?
In general, porridge in my head, and the celery dock does not help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2018-07-15
@dimonchik2013

you can also not take a steam bath and watch separately
together, but it’s not without reason separately

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question