googleapis/google-cloud-java

[java-logging] Improve the Write logEntry sample

开放

#11,923 创建于 2020年12月10日

 (0 条评论) (0 个反应) (1 位负责人)Java (1,082 个派生)batch import
api: logginggood first issuelang: javapriority: p3samplestype: feature request

仓库指标

星标
 (1,763 个星标)
PR 合并指标
 (平均合并 5天 7小时) (30 天内合并 195 个 PR)

描述

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

贡献者指南