googleapis / googleapis/google-cloud-java

[java-logging] Improve the Write logEntry sample

Open
#11,923 0 comments 0 reactions 1 assignee Claimed by @arbrown View on GitHub
api: logging good first issue lang: java priority: p3 samples type: feature request
Dominant language
Java
Stars
2.1k
Forks
1.2k
Avg merge
1d 23h
Merged PRs (30d)
154

Description

Improve the Write logEntry sample on [this page](https://cloud.google.com/logging/docs/samples/logging-write-log-entry)

This page is referenced by [docs](https://cloud.google.com/logging/docs/api/tasks/creating-logs) 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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.