Search code examples
logginggcloudwinstongoogle-cloud-stackdriver

where the log of gcloud logging winston written to


i'm using @google-cloud/logging-winston

and flow this quickstart

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%');

in below, there're the comment that:

Logs will be written to: "projects/YOUR_PROJECT_ID/logs/winston_log"

but i can't find it any where, even LOGGING in gcloud console

enter image description here

Where can i find these log

many thanks


Solution

  • The log data will be written to the Stackdriver Logging resource Global and to the log winston_log.

    Go to the Google Cloud Console. Select Stackdriver Logging.

    Under the Filter by label or text search is a drop down list.

    Select Global. Next to this control is All logs. Select winson_log.