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

Help: How to skip pushing logs from certain global logger #191

Closed
overide opened this issue Oct 10, 2023 · 3 comments
Closed

Help: How to skip pushing logs from certain global logger #191

overide opened this issue Oct 10, 2023 · 3 comments

Comments

@overide
Copy link

overide commented Oct 10, 2023

I've made changes in my celery app config to push celery logs on the cloudwatch but I'm interested in only task related logs and nothing else. But what i can see on the cloud watch, it pushed logs from all celery related logs -

image

I'm only interested in the celery.app.trace-23-10-10 log or better if i can merge all celery related logs into one.

How can I do that?

Thank you!

@overide
Copy link
Author

overide commented Oct 11, 2023

I think adding a filter on the watchtower handler which filters out the undesirable log will be a solution.

But I still don't know how to send all celery-related logs to a single stream.

@kislyuk
Copy link
Owner

kislyuk commented Oct 14, 2023

Hello, thank you for your interest in watchtower.

This library is a log handler and does not filter any logs except those related to its own operation. To merge logs into one log group, you can specify the log group name instead of using the default log group name that corresponds to the logger name. The Python logging library natively supports filtering logs using a variety of techniques, including filters (https://docs.python.org/3/library/logging.html#logging.Logger.addFilter), to accomplish what you describe.

@kislyuk
Copy link
Owner

kislyuk commented Oct 14, 2023

Since this issue is not describing a bug in watchtower, I'm going to close it for now.

@kislyuk kislyuk closed this as completed Oct 14, 2023
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

2 participants