-
Notifications
You must be signed in to change notification settings - Fork 47
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
Add a parameter route_logs_to_stdout_as_json to the CloudLoggingExporter #385
base: main
Are you sure you want to change the base?
Conversation
@@ -215,11 +222,15 @@ def export(self, batch: Sequence[LogData]): | |||
for k, v in attributes.items() | |||
} | |||
_set_payload_in_log_entry(log_entry, log_record.body) | |||
log_entries.append(log_entry) | |||
if self.route_logs_to_stdout_as_json: | |||
print(LogEntry.to_json(log_entry)) |
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.
Have you seen https://cloud.google.com/logging/docs/structured-logging?
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.
I'm confused. Should I just be logging the jsonPayload field of the log ?
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.
I think we need quite a bit more stuff here, like documenting why and how the user would use this.
FYI you can link to bugs similar to |
add a parameter route_logs_to_stdout_as_json to the CloudLoggingExporter