Tag: google cloud logging

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": […]