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

Disable uvicorn logger to remove duplicated messages #870

Merged
merged 4 commits into from
May 26, 2022

Conversation

antonymilne
Copy link
Contributor

@antonymilne antonymilne commented May 26, 2022

Description

Did you ever notice how chatty kedro-viz logging is and that all the messages are duplicated?
image

Now that we're changing kedro's default logger to something more beautiful in kedro-org/kedro#1512, the duplication is even more stark and makes the output look wack:
image

The reason for this is that uvicorn sets up its own custom logger, and then kedro's logging is also there, so messages get duplicated. The solution is to disable uvicorn's logger. I left the log level set to what they use (INFO) so that we still get a lot of messages, just they're no longer duplicated.

After kedro-org/kedro#1512 and this are merged, kedro viz log messages will then look super sexy, like this:
image

There's no need to wait until #1512 is merged to merge this though. We can go ahead with this right away.

Checklist

  • Read the contributing guidelines
  • Opened this PR as a 'Draft Pull Request' if it is work-in-progress
  • Updated the documentation to reflect the code changes
  • Added new entries to the RELEASE.md file
  • Added tests to cover my changes

Signed-off-by: Antony Milne <[email protected]>
@antonymilne antonymilne requested a review from limdauto as a code owner May 26, 2022 16:45
Signed-off-by: Antony Milne <[email protected]>
@datajoely
Copy link
Contributor

🔥

Signed-off-by: Antony Milne <[email protected]>
Copy link
Collaborator

@limdauto limdauto left a comment

Choose a reason for hiding this comment

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

Danker. I'm guilty of never reading this log

@limdauto
Copy link
Collaborator

@AntonyMilneQB although could you help me check if you throw an error in one of the endpoint, does the stack trace get logged correctly?

Copy link
Member

@tynandebold tynandebold left a comment

Choose a reason for hiding this comment

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

Excellent

@antonymilne antonymilne changed the title Change uvicorn logger Disable uvicorn logger to remove duplicated messages May 26, 2022
@antonymilne
Copy link
Contributor Author

@limdauto Just checked this and it does 👍 All the same log messages get through as before, just they don't get duplicated now.

@antonymilne antonymilne merged commit 7687147 into main May 26, 2022
@antonymilne antonymilne deleted the fix/uvicorn-logger branch May 26, 2022 20:08
@tynandebold tynandebold mentioned this pull request Jun 16, 2022
5 tasks
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.

4 participants