Skip to content

Commit

Permalink
Bring Logging Sinks samples up to standard.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmdobry committed Aug 19, 2016
1 parent ffe2476 commit 61d9faf
Show file tree
Hide file tree
Showing 10 changed files with 731 additions and 186 deletions.
37 changes: 31 additions & 6 deletions logging/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Web Services.
* [Samples](#samples)
* [Reading logs](#reading-logs)
* [Writing logs](#writing-logs)
* [Exporting logs](#exporting-logs)
* [Sinks](#sinks)
* [Error Reporting on Compute Engine](#error-reporting-on-compute-engine)
* [Logging to Google Cloud with Winston](https://github.com/GoogleCloudPlatform/winston-gae)

Expand Down Expand Up @@ -52,16 +52,41 @@ __Run the sample:__
[write_docs]: https://cloud.google.com/logging/docs/api/tasks/creating-logs
[write_code]: write.js

### Exporting logs
### Sinks

View the [documentation][export_docs] or the [source code][export_code].

__Run the sample:__

node export
__Usage:__ `node sinks --help`

```
Commands:
create <name> <destination> Create a new sink with the given name and destination.
get <name> Get the metadata for the specified sink.
list List all sinks in the authenticated project.
update <name> <metadata> Update the metadata for the specified sink.
delete <name> Delete the specified sink.
Options:
--help Show help [boolean]
Examples:
node sinks create my-sink my-bucket --type bucket Create a new sink named "my-sink" that exports
logs to a Cloud Storage bucket.
node sinks create my-sink my-dataset --type Create a new sink named "my-sink" that exports
dataset logs to a BigQuery dataset.
node sinks create my-sink my-topic --type topic Create a new sink named "my-sink" that exports
logs to a Cloud Pub/Sub topic.
node sinks get my-sink Get the metadata for "my-sink".
node sinks list List all sinks in the authenticated project.
node sinks update my-sink '{"filter":"severity > Update the specified sink.
ALERT"}'
node sinks delete my-sink Delete "my-sink".
For more information, see https://cloud.google.com/logging/docs
```

[export_docs]: https://cloud.google.com/logging/docs/api/tasks/exporting-logs
[export_code]: export.js
[export_code]: sinks.js

### Error Reporting on Compute Engine

Expand Down
127 changes: 0 additions & 127 deletions logging/export.js

This file was deleted.

3 changes: 1 addition & 2 deletions logging/write.js → logging/logs.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.

/* jshint camelcase:false */
'use strict';

var async = require('async');

// [START write]
// [START all]
// [START setup]
// By default, the client will authenticate using the service account file
// specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable and use
Expand Down
8 changes: 5 additions & 3 deletions logging/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
"system-test": "mocha -R spec -t 120000 --require intelli-espower-loader ../system-test/_setup.js system-test/*.test.js"
},
"dependencies": {
"@google-cloud/logging": "^0.1.1",
"async": "^2.0.1",
"express": "^4.13.4",
"fluent-logger": "^2.0.1"
"fluent-logger": "^2.0.1",
"google-cloud": "^0.38.3",
"yargs": "^5.0.0"
},
"devDependencies": {
"mocha": "^3.0.2"
"mocha": "^3.0.2",
"node-uuid": "^1.4.7"
}
}
Loading

0 comments on commit 61d9faf

Please sign in to comment.