-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Purpose:
One of the current, most notable issues with Winston today is the how we handle the application of default metadata for a given instance of a logger. As it stands the current implementation makes some bad assumptions around metadata precedence in different contexts. This issue is being created to consolidate all relevant/duplicate issues & the associated Pull Requests.
Consolidations
Below is a compiled list of all issues and pull requests I have been able to find regarding this issue. They are sorted newest to oldest. All issues below are going to be marked as a duplicate and then closed. This is being done to hopefully centralize all efforts for resolving this issue to this issue moving forward.
Issues:
Potential Regression Issues
These are all the issues that reference
3.7.1
&3.7.2
- Error objects can no longer be logged
- [Bug]: TypeError encountered when logging class extending superclass which contains protected property #2103
- [Bug]: defaultMeta returns object not string #2144
- [Bug]: default metadata is not added on log message of profiler #2162
- [Bug]: method logger.child({defaultMeta: true}) doesen't add default meta object in the splat property of the info object #2168
- likely can be considered unrelated for time being as it's specific to the SPLAT format
- [Bug]: Message key in metadata overwrites original message #2306
- Need to verify test cases cover this issue
Original Issues:
- Deep merge meta objects #1884 (I believe this would be a departure from currently documented behavior)
- Combine child metadata with additional metadata #1864
- Child Logger Doesn't Override Parent Metadata #1788
- defaultMeta ignored when using logger.log function but not in logger[level] functions #1759
- Profiler.done doesn't respect defaultMeta. #1665
- Log / info methods don't respect metadata overrides #1596
- Winston loses Map and Set properties on meta #1054
Pull Requests:
- Fix how metadata works #2037 (Centered around Request: Functions in Default Metadata #1626 but also claims to solve metadata override issues)
- fix(metadata precedence) - fix metadata override issues #1989 (Recreation of my original PR)
- Fix child logger overrides #1943
- Fix: Missing defaultMeta in log entry while using Profiler #1935 (Implements a fix for Profiler.done doesn't respect defaultMeta. #1665 but in a manner that I feel introduces maintenance burden)
- Deep merge meta objects #1885
- root & child meta-data #1883
- Default metadata application fixes #1879
- Fix defaultMeta override in child logger #1864 #1875
- Enable child logger to override parent metadata #1782
- Fix bug in overriding default metadata in child loggers. #1598 (opened by myself)
Notes
If you're aware of any other Issues or PRs (including those that have been closed) that are not included above please let me know and I'll get them added to the list.