Project

Profile

Help

Task #2971

enable celery workers to log at levels below WARN

Added by mhrivnak about 2 years ago. Updated 6 months ago.

Status:
CLOSED - WONTFIX
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
Start date:
Due date:
% Done:

0%

Platform Release:
Blocks Release:
Backwards Incompatible:
No
Groomed:
No
Sprint Candidate:
No
Tags:
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:

Description

Celery workers set their own log level somehow. You can supply one via a celery setting, either on the command line or as an environment variable.

http://docs.celeryproject.org/en/v4.1.0/reference/celery.bin.worker.html#cmdoption-celery-worker-l

It defaults to WARN. I was able to get the workers to log at info by adding "--loglevel=INFO" to the worker unit file. That is probably not the best approach though. It is desirable to have a setting that can enable DEBUG logging across all of Pulp or not.

I think in Pulp 2 there was a mechanism for overriding whatever log level celery set, but I'm not entirely sure. This task is to figure out a reasonable approach for setting the log level across pulp and to make it happen.


Checklist


Related issues

Duplicates Pulp - Issue #2906: Level INFO messages not being logged in worker processes. MODIFIED Actions

History

#1 Updated by bizhang about 2 years ago

There is a celery setting to stop it from hijacking the root logger: http://docs.celeryproject.org/en/master/userguide/configuration.html#worker-hijack-root-logger

#2 Updated by bizhang about 2 years ago

Another issue is that celery does no use the provided formatter when it hijacks logging.
Because of this I would recommend we stop celery from hijacking the root logger instead of re-configuring celery logging with the correct formatter in addition to the correct log level.

#3 Updated by bizhang about 2 years ago

I looks that the worker_hijack_root_logger only stops celery from hijacking the handlers and not the loglevel. [0]

The way to stop if from hijacking everything is to use the celery setup_logging signal as per:
https://github.com/celery/celery/issues/2509#issuecomment-153936466

[0] https://github.com/celery/celery/blob/29b62aed17e99980668984446923089f17d300c0/celery/app/log.py#L110

#4 Updated by mhrivnak about 2 years ago

  • Duplicates Issue #2906: Level INFO messages not being logged in worker processes. added

#5 Updated by mhrivnak about 2 years ago

  • Status changed from NEW to CLOSED - DUPLICATE

#6 Updated by dalley over 1 year ago

  • Status changed from CLOSED - DUPLICATE to NEW

#7 Updated by dalley over 1 year ago

  • Status changed from NEW to CLOSED - WONTFIX

No longer applicable w/ switch away from Celery

#8 Updated by daviddavis 6 months ago

  • Sprint/Milestone set to 3.0

#9 Updated by bmbouter 6 months ago

  • Tags deleted (Pulp 3)

Please register to edit this issue

Also available in: Atom PDF