{LoggingBunyan} = require('@google-cloud/logging-bunyan’); const loggingBunyan = new LoggingBunyan(); // Create a Bunyan logger that streams to Stackdriver Logging // Logs will be written to: "projects/YOUR_PROJECT_ID/logs/bunyan_log“ const logger = bunyan.createLogger({ // The JSON payload of the log as it appears in Stackdriver Logging // will contain "name": "my-service" name: 'default-service-stackdriver-node-demo’, streams: [ // Log to the console at 'info' and above {stream: process.stdout, level: 'debug'}, // And log to Stackdriver Logging, logging at 'info' and above loggingBunyan.stream('info'), ], });