-
Notifications
You must be signed in to change notification settings - Fork 104
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
Adding support for debug logs in executed functions. #745
Conversation
I remember @ankitkumarr and I once dealt with a CRI where a customer's application performance got impacted due to too many logs from azure-storage-blob. Since we're now enabling debug in Python in the root logger, I expect to see a bit more logger.debug from azure-storage-blob. (e.g. https://github.com/Azure/azure-storage-python/blob/4e03ff8c9d6c76a38666a8ceb8937593e93fb7eb/azure-storage-common/azure/storage/common/_auth.py#L93.) I think it would be great if you can create some test cases with a host.json that controls the log level, and see if the host actually filters our worker logs. "logging": {
"logLevel": {
"Function.MyFunction": "Information",
"default": "None"
} Currently, the Python worker tests all use host.json from testutils.py -> HOST_JSON_TEMPLATE. When the test starts, it will copy the content to each unittest folder's root (e.g. tests/unittests/http_functions/host.json) in testsutils.py -> _setup_func_app. If not taking too much time, you can create a new test instance to modify the host.json context before starting the test host. Let me know if you have any questions. |
Done - added a new set of tests with Information log level (default) set to confirm debug logs are not sent. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.assertIn('logging info', host_out) | ||
self.assertIn('logging warning', host_out) | ||
self.assertIn('logging error', host_out) | ||
self.assertNotIn('logging debug', host_out) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, this explicitly test the scenario on the host logging control side. Thanks for making the change
Description
Changing the default log level to
Debug
. The configuration of the log levels is set at the host.json.FYI @stefanushinardi @anthonychu
Fixes #735
PR information
Quality of Code and Contribution Guidelines