Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Message key in metadata overwrites original message #2306

Open
adamrdavid opened this issue May 19, 2023 · 1 comment
Open

[Bug]: Message key in metadata overwrites original message #2306

adamrdavid opened this issue May 19, 2023 · 1 comment

Comments

@adamrdavid
Copy link

🔎 Search Terms

message, metadata

The problem

The readme states:

NOTE: any { message } property in a meta object provided will automatically be concatenated to any msg already provided: For example the below will concatenate 'world' onto 'hello':

logger.log('error', 'hello', { message: 'world' });
logger.info('hello', { message: 'world' });

Expected result:

info: hello world

Actual result:

info: world

It seems that instead of concatenating, the first message is replaced.

What version of Winston presents the issue?

3.7.0

What version of Node are you using?

16.19.1

If this worked in a previous version of Winston, which was it?

No response

Minimum Working Example

logger.error('my message', { message: 'concat this' });

Additional information

No response

@maverick1872
Copy link
Member

Thanks for the report @adamrdavid & the MWE. Given this is metadata related I'll be adding it to #2029 for tracking there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants