Skip to content

Conversation

@txgruppi
Copy link
Contributor

@txgruppi txgruppi commented Oct 2, 2019

The problem

When calling logger.log with two string values it does not add the values from defaultMeta.

Before

const logger = winston.createLogger({
  defaultMeta: {testing: 'it works!'},
  transports: [new Console()],
});
logger.log('info', 'did it work?'); // {"level":"info","message":"did it work?"}

After

const logger = winston.createLogger({
  defaultMeta: {testing: 'it works!'},
  transports: [new Console()],
});
logger.log('info', 'did it work?'); // {"level":"info","message":"did it work?","testing":"it works!"}

@MojoDeMedici
Copy link

This should be push, it solves indeed the issue.

@alvinalexander
Copy link

alvinalexander commented Apr 10, 2020

Please merge this!

@DABH DABH merged commit 68ea786 into winstonjs:master Jul 11, 2020
@txgruppi txgruppi deleted the add-default-meta-to-string-msg branch July 15, 2020 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants