'use strict';
const Hapi = require('hapi');
const server = new Hapi.Server();
server.connection({ uri: 'http://mysite.com' }); // logs will respect server.info.uri, set it here if you want them to be pretty
server.register([{
register: require('good-google-cloud') // setup some event listeners that gather extra context
}, {
register: require('good'),
options: {
reporters: {
google: [{
module: 'good-squeeze',
name: 'Squeeze',
args: [{ request: '*', response: '*', log: '*', error: '*' }]
}, {
module: 'good-google-cloud',
name: 'Logger',
args: [{ name: 'my-app' }] // "name" will be used as your log name, as well as the operation producer
// you must either export GCLOUD_PROJECT in your environment or pass a "project_id" property if you want your logs
// to go to the "Global" resource, you can also pass a "resource" object here to define where your logs will go more specifically
}]
}
}
}], (err) => {
if (err) {
throw err;
}
server.start(() => {
server.log(['info'], 'my-app started');
});
});
-
Notifications
You must be signed in to change notification settings - Fork 3
nodesecurity/good-google-cloud
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Packages 0
No packages published