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

docs: Added documentation for Django/Flask integrations and dictConfig #848

Merged
merged 7 commits into from
Feb 14, 2024

Conversation

gkevinzheng
Copy link
Contributor

  • Added sample code for dictConfig
  • Added documentation for Django/Flask integration setup

Fixes #429
Fixes #844

Copy link

snippet-bot bot commented Feb 1, 2024

Here is the summary of changes.

You are about to add 2 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: logging Issues related to the googleapis/python-logging API. labels Feb 1, 2024
Copy link
Contributor

@daniel-sanche daniel-sanche left a comment

Choose a reason for hiding this comment

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

LGTM, with a few small suggestions

"handlers": {
"cloud_logging": {
"class": "google.cloud.logging.handlers.CloudLoggingHandler",
"client": client,
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe the client setup should be part of the sample?


Django integration has been tested to work with each of the Django/Python versions listed `here <https://docs.djangoproject.com/en/5.0/faq/install/#what-python-version-can-i-use-with-django>`_.
To enable Django integration, add `google.cloud.logging_v2.handlers.middleware.RequestMiddleware` to the list of `MIDDLEWARE`
in your settings file. Also be sure to :doc:`set up logging </std-lib-integration>` in your settings file.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add a link like this to "settings file"? https://docs.djangoproject.com/en/5.0/topics/settings/

@gkevinzheng gkevinzheng added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 13, 2024
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 13, 2024
@gkevinzheng gkevinzheng merged commit c65ec92 into main Feb 14, 2024
16 of 17 checks passed
@gkevinzheng gkevinzheng deleted the django-docs branch February 14, 2024 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: logging Issues related to the googleapis/python-logging API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

document django middleware docs: validate django/flask versions
4 participants