Skip to content

Commit 106f256

Browse files
committed
Add examples and snippets for Logging
1 parent e3321a7 commit 106f256

6 files changed

Lines changed: 764 additions & 0 deletions

File tree

gcloud-java-examples/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,19 @@ To run examples from your command line:
100100
mvn exec:java -Dexec.mainClass="com.google.cloud.examples.dns.DnsExample" -Dexec.args="delete some-sample-zone"
101101
```
102102
103+
* Here's an example run of `LoggingExample`.
104+
105+
Before running the example, go to the [Google Developers Console][developers-console] to ensure
106+
that Logging API is enabled.
107+
```
108+
target/appassembler/bin/LoggingExample create metric test-metric severity>=ERROR
109+
target/appassembler/bin/LoggingExample list metrics
110+
target/appassembler/bin/LoggingExample create sink test-sink bucket test-bucket severity>=ERROR
111+
target/appassembler/bin/LoggingExample list sinks
112+
target/appassembler/bin/LoggingExample write test-log-name ERROR test-message test-key test-value
113+
target/appassembler/bin/LoggingExample list entries
114+
```
115+
103116
* Here's an example run of `ResourceManagerExample`.
104117
105118
Be sure to change the placeholder project ID "your-project-id" with your own globally unique project ID.

0 commit comments

Comments
 (0)