googleapis/google-cloud-python

Improve the Write logEntry sample

Geschlossen

#15.426 geöffnet am 10.12.2020

 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)Python (1.481 Forks)batch import
api: logginggood first issuepriority: p3samplestype: feature request

Repository-Metriken

Stars
 (4.304 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 4T) (158 gemergte PRs in 30 T)

Beschreibung

Improve the Write logEntry sample on this page

This page is referenced by docs that explicitly talk about LogEntries. So we should demo this “advanced” logging technique, even though we do recommend the standard log wrapper approach in the quickstarts.

Criteria:

  • Demo how to write a text logEntry (textPayload)
  • Demo how to write a struct logEntry (jsonPayload)
  • Include: severity level, labels, resource type (“global”)
  • Demo: batch logging vs writing one log at a time
  • Update accompanying tests

Region tag: logging_write_log_entry

Contributor Guide