Node.js @ google-cloud / logging-winston不能在GCE实例内工作

我正在使用npm @ google-cloud / logging-winston将应用程序日志事件发送到Google堆栈驱动程序日志接收器。 下面是我的代码片段,它在我的本地macbook中工作得很好。 当我尝试在GCE实例(谷歌云上的Ubuntu 16.10图像计算实例)中运行它时,它不会将日志事件发送到日志接收器,我无法在Google云日志logging仪表板上看到它。 任何帮助在这里赞赏

///// code start here const winston = require('winston'); const Logger = winston.Logger; const Console = winston.transports.Console; const LoggingWinston = require('@google-cloud/logging-winston'); // Instantiates a Winston Stackdriver Logging client const loggingWinston = LoggingWinston({ projectId: 'myproject-id', keyFilename: 'mykey.json', level: 'info',// log at 'warn' and above , labels: { "env": "poc" } , logName: "poc-gcl.log" }); // Create a Winston logger that streams to Stackdriver Logging // Logs will be written to: "projects/YOUR_PROJECT_ID/logs/winston_log" const logger = new Logger({ level: 'info', // log at 'info' and above transports: [ // Log to the console new Console(), // And log to Stackdriver Logging loggingWinston ] }); // Writes some log entries logger.info('Node Winston logger initialized.Transport GCL Stakdriver logging', { type: "poc", server: "test" }); //code ends here. 

在此先感谢 – jag