Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I log with INFO level from a job? #2069

Open
anton-daneyko-ultramarin opened this issue Apr 7, 2024 · 0 comments
Open

How do I log with INFO level from a job? #2069

anton-daneyko-ultramarin opened this issue Apr 7, 2024 · 0 comments

Comments

@anton-daneyko-ultramarin

I am having hard time figuring out how to get some info level logs from a job. Maybe I am missing some basic config? Here's what I do:

logtask.py:

import logging


logger = logging.getLogger(__name__)


def logsome():
    logger.error("error")
    logger.info("info")

Enqueue a job:

rq enqueue logtask.logsome

Run worker with info logging level and observe only error level log message is shown:

$ rq worker --logging_level=INFO
17:09:01 Worker rq:worker:98a4971a653247d29d2a39174b5a7258 started with PID 88963, version 1.15.1
17:09:01 Subscribing to channel rq:pubsub:98a4971a653247d29d2a39174b5a7258
17:09:01 *** Listening on default...
17:09:10 default: logtask.logsome() (5af1fc8b-f3af-400e-82e1-0d8111d4ccfb)
error
17:09:10 default: Job OK (5af1fc8b-f3af-400e-82e1-0d8111d4ccfb)
17:09:10 Result is kept for 500 seconds
17:27:20 Cleaning registries for queue: default
17:53:59 Cleaning registries for queue: default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant