Logging 温斯顿写的gcloud日志记录在哪里
我正在使用@googlecloud/logging winston 然后快速启动Logging 温斯顿写的gcloud日志记录在哪里,logging,gcloud,winston,google-cloud-stackdriver,Logging,Gcloud,Winston,Google Cloud Stackdriver,我正在使用@googlecloud/logging winston 然后快速启动 const winston = require('winston'); const {LoggingWinston} = require('@google-cloud/logging-winston'); const loggingWinston = new LoggingWinston(); const logger = winston.createLogger({ level: 'info',
const winston = require('winston');
const {LoggingWinston} = require('@google-cloud/logging-winston');
const loggingWinston = new LoggingWinston();
const logger = winston.createLogger({
level: 'info',
transports: [
new winston.transports.Console(),
loggingWinston,
],
});
logger.error('warp nacelles offline');
logger.info('shields at 99%');
下面是一条评论:
日志将写入:“projects/YOUR\u PROJECT\u ID/Logs/winston\u log”
但我在任何地方都找不到它,甚至登录到gcloud控制台
我在哪里可以找到这些日志
非常感谢日志数据将写入Stackdriver日志资源全局和日志
winston_log
转到谷歌云控制台。选择Stackdriver Logging
在“按标签或文本搜索过滤”下有一个下拉列表
选择
Global
。此控件旁边是所有日志
。选择winson\u log
我已经按照您提到的方法在Google App Engine标准应用程序上运行了代码。我把那些原木弄得很好。代码在哪里运行,是否部署在GAE应用程序、计算引擎实例中。。?另一方面,我看到您正在服务帐户中查找日志,您应该检查您正在使用的组件。日志数据将写入资源Global
和日志winston\u log
更改您拥有服务帐户的控件, logger@...
toGlobal
@PabloAlmécijaRodríguez我正在本地机器上使用ServiceAccount JohnHanley运行代码我在Global!中找到了它!。非常感谢你。关键是我认为日志将在我提供的服务帐户中,所以没有找到it@JohnHanley您能否将您的评论作为一个答案,以便对可能遇到此问题的其他用户具有更高的可视性?