Ramesh Lingappa
Ramesh Lingappa

Reputation: 2488

Appengine NodeJS Flexible logging-winston logs not printing

I have been using @google-cloud/logging-winston module for logging in appengine flexible environment.

But recently I noticed no logs are printing under 'winston_log' logName, its only printing in stout, following is my configuration:

const logLevel = 'info'

const transports = [new Console({level: logLevel, colorize: isDevMode(), timestamp: isDevMode()})]
transports.push(LoggingWinston({level: logLevel}))

// application logger
const logger = new winston.Logger({ transports: transports })

logger.error('error test') // no logLevel
logger.info('app listening on port 8080') // no logLevel
logger.debug('debug test') // no logLevel

Nothing is printing under 'winsont_log' logName, all logs are printed only in console like below:

enter image description here

Any help?

Upvotes: 0

Views: 316

Answers (1)

Abhishek Singh
Abhishek Singh

Reputation: 2727

Currently, you are using console transport that is why you are getting logs inside the console window. Instead, use File transport to write logs in the log file.

Upvotes: 0

Related Questions