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]: default metadata is not added on log message of profiler #2162

Open
geertendoornenbal opened this issue Jul 12, 2022 · 9 comments
Open

Comments

@geertendoornenbal
Copy link

🔎 Search Terms

metadata profiler

The problem

When logging a message with the profiler, the default meta data of the logger instance is not added to the log message.

It is calling this.logger.write() directly, and it should have the added default metadata as well.

I worked around it by adding the defaultMeta myself:
profiler.done({ message: "Finished complete request", ...logger.defaultMeta });

What version of Winston presents the issue?

v3.8.1

What version of Node are you using?

v16.16.0

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

No response

Minimum Working Example

No response

Additional information

No response

@wbt
Copy link
Contributor

wbt commented Jul 14, 2022

Does using v3.7.0 (specifically) happen to fix the issue? There were a bunch of metadata changes in that one that were quickly reverted in 3.7.1 but it'd be good to know if they address this.

@Maksym-L
Copy link

Maksym-L commented Oct 4, 2022

I have same issue: "winston": "^3.8.2"

@wbt
Copy link
Contributor

wbt commented Oct 18, 2022

The issue is reported in the current version; the ask was to see if pinning specifically to v3.7.0 fixes the issue or not.

@geertendoornenbal
Copy link
Author

I tried to, but it is not present in npm anymore:
https://www.npmjs.com/package/winston?activeTab=versions

@wbt
Copy link
Contributor

wbt commented Nov 18, 2022

Try 3.7.1 - looks like that has the same potential fix, reverted by 3.7.2

@geertendoornenbal
Copy link
Author

Yup, 3.7.1 works

@wbt
Copy link
Contributor

wbt commented Nov 23, 2022

@maverick1872 FYI

@maverick1872
Copy link
Member

@maverick1872 FYI

I need to set aside some time to sort through all this again. Maybe publish a RC version that people can leverage in the meantime and report issues on?

@wbt
Copy link
Contributor

wbt commented Nov 28, 2022

You can treat 3.7.1 as that RC, but a failing one as described in #2103...

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

4 participants