Skip to content

Categorize SDK logs as system logs #850

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

Merged
merged 2 commits into from
Jun 2, 2021
Merged

Categorize SDK logs as system logs #850

merged 2 commits into from
Jun 2, 2021

Conversation

Hazhzeng
Copy link
Contributor

@Hazhzeng Hazhzeng commented May 12, 2021

Description

Dependency Azure/azure-functions-python-library#88
Fixes ##840

From now on, we will treat 'azure.functions' namespace and its child namespace as system logs.
After merging this PR, we should be able to see the following log lines in our Kusto table:

  1. Instantiating Azure Functions ASGI middleware.
  2. Instantiating Azure Functions WSGI middleware.

This will help the PM team calculate the usage on WSGI/ASGI middlewares.

Core changes in azure_functions_worker/logging.py.

cc: @stefanushinardi @vrdmr @AnatoliB


PR information

  • The title of the PR is clear and informative.
  • There are a small number of commits, each of which has an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, see this page.
  • If applicable, the PR references the bug/issue that it fixes in the description.
  • New Unit tests were added for the changes made and CI is passing.

Quality of Code and Contribution Guidelines

Copy link
Member

@vrdmr vrdmr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit comments; lgtm.

@@ -20,6 +19,15 @@


class TestLogFilteringFunctions(testutils.WebHostTestCase):
"""This class is for testing the logger behavior in Python Worker when
dealing with customer's log and system's log. Here's a list of expected
behaviors:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit; you don't need to mention this - if you have mentioned this earlier. Just give a reference of is_system_log_category and that should be good enough.

@@ -50,6 +58,7 @@ def check_log_debug_logging(self, host_out: typing.List[str]):
self.assertIn('logging info', host_out)
self.assertIn('logging warning', host_out)
self.assertIn('logging error', host_out)
# See HOST_JSON_TEMPLATE_WITH_LOGLEVEL_INFO, debug log is disabled
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry - didnt understand this - where is this pointing to?

Here's a list of expected behaviors:
local_console customer_app_insight functions_kusto_table
system_log false false true
customer_log true true false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

@Hazhzeng Hazhzeng merged commit a3c047b into dev Jun 2, 2021
@Hazhzeng Hazhzeng deleted the hazeng/asgi-log branch June 2, 2021 17:22
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

Successfully merging this pull request may close these issues.

2 participants