Reputation: 2488
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:
Any help?
Upvotes: 0
Views: 316
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