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

[FeatureRequest] support for filtering logs #743

Open
bmc-msft opened this issue Sep 22, 2020 · 3 comments · May be fixed by #1167
Open

[FeatureRequest] support for filtering logs #743

bmc-msft opened this issue Sep 22, 2020 · 3 comments · May be fixed by #1167
Assignees
Milestone

Comments

@bmc-msft
Copy link

User functions have a single global log level. It would beneficial to enable an consistent mechanism to add filter logging prior to the logs hitting app-insights.

@anthonychu
Copy link
Member

Our guidance is to configure filtering on the host, is able to filter logs from the app, the Python language worker, as well as the host itself.

It is a bit difficult to figure out the log categories without going to App Insights. I have some samples here: https://github.com/anthonychu/functions-log-suppression

@stefanushinardi
Copy link

As Anthony already mentioned, you could use host.json config to specify your log level. For Python specifically, we have a change that is pending deployment to fix DEBUG log level bug: #735

@bmc-msft
Copy link
Author

bmc-msft commented Oct 1, 2020

Many python libraries set their level to 'info' and include debug information at that level, including Azure SDK libraries. I want to set the info level for my app's logs, but not all of the logging from all of the libraries that I use.

If this was a standard python app, I would setup a logging.basicConfig with the default level to warning, then set my app specific logger to INFO. However, I don't have a direct handle to the azure functions worker's logging handle.

I could update the context of the azure_functions_worker.logger.handler on every execution to add this filtering, that seems fragile.

Is there way to handle this use case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants