Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Logging 温斯顿写的gcloud日志记录在哪里_Logging_Gcloud_Winston_Google Cloud Stackdriver - Fatal编程技术网

Logging 温斯顿写的gcloud日志记录在哪里

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',

我正在使用@googlecloud/logging winston

然后快速启动

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@...
to
Global
@PabloAlmécijaRodríguez我正在本地机器上使用ServiceAccount JohnHanley运行代码我在Global!中找到了它!。非常感谢你。关键是我认为日志将在我提供的服务帐户中,所以没有找到it@JohnHanley您能否将您的评论作为一个答案,以便对可能遇到此问题的其他用户具有更高的可视性?