Skip to content

[DRAFT] Support Json logs #304

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

Closed
wants to merge 21 commits into from
Closed

Conversation

daniel-sanche
Copy link
Contributor

@daniel-sanche daniel-sanche commented May 21, 2021

This PR adds full support for JSON logs, along with standard text logs. Now, users can call logging.error({'a':'b'}), and they will get a JsonPayload in Cloud Logging, Or call logging.error('test') to receive a TextPayload

As part of this change, I added a generic loger.log() function, which serves as a generic entry-point instead of logger.log_text or logger.log_struct. It will infer which log function is meant based on the input type

Previously, the library would attach the python logger name as part of the JSON payload for each log. Now, that information will be attached as a label instead, giving users full control of the log payload fields

Fixes #186, #263, #13

@product-auto-label product-auto-label bot added the api: logging Issues related to the googleapis/python-logging API. label May 21, 2021
@daniel-sanche daniel-sanche changed the base branch from master to v3.0.0 May 21, 2021 17:47
@daniel-sanche daniel-sanche self-assigned this May 21, 2021
@daniel-sanche daniel-sanche added kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. labels May 21, 2021
@yoshi-kokoro yoshi-kokoro removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels May 21, 2021
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label May 21, 2021
@daniel-sanche daniel-sanche changed the base branch from v3.0.0 to deprecate_old_handlers May 21, 2021 20:10
@daniel-sanche
Copy link
Contributor Author

closed in favor of #316. Had to rebase branch

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. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants