Skip to content

Respecting winston formatting #540

@krzysiekfonal

Description

@krzysiekfonal

This logger ignores format settings.

const logger = winston.createLogger({
    level: LOG_LEVEL,
    format: winston.format.combine(
        winston.format.timestamp({format: 'YYYY-MM-DD HH:mm:ss,SSS'}),
        winston.format.printf(info => `${info.timestamp} |${info.level.toUpperCase()}| my-service -> ${info.message}`)),
    transports: [
        new LoggingWinston(), 
        new winston.transports.Console()
    ]
});

In the above example, console logs presents proper format defined in 'format' field, but google-cloud/logging-winston doesn't.

Metadata

Metadata

Assignees

Labels

api: loggingIssues related to the googleapis/nodejs-logging-winston API.lang: nodejsIssues specific to JavaScript or TypeScript.priority: p2Moderately-important priority. Fix may not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions