This module provides an easy to use, higher-level layer for working with Stackdriver Logging, compatible with Winston. Simply attach this as a transport to your existing Winston loggers.
var winston = require('winston');
var transport = require('@google-cloud/logging-winston');
winston.add(transport, {
projectId: 'grape-spaceship-123',
keyFilename: '/path/to/keyfile.json',
level: 'warning', // log at 'warning' and above
resource: {
type: 'global'
}
});
winston.error('warp nacelles offline');
winston.verbose('sheilds at 99%');