[Bug]: defaultMeta returns object not string
See original GitHub issue🔎 Search Terms
defaultmeta
The problem
defaultMeta does’t appears as string in the log
const logger = winston.createLogger({
level: 'info',
format: production ? ecsFormat({ convertReqRes: true }) : winston.format.simple(),
defaultMeta: { service: 'account' },
transports: [new winston.transports.Console()]
});
but it displays service like that in the log
{
"service":
{
"0": "a",
"1": "c",
"2": "c",
"3": "o",
"4": "u",
"5": "n",
"6": "t"
}
}
What version of Winston presents the issue?
v3.3.3
What version of Node are you using?
v16.15.0
If this worked in a previous version of Winston, which was it?
No response
Minimum Working Example
const logger = winston.createLogger({
level: 'info',
format: production ? ecsFormat({ convertReqRes: true }) : winston.format.simple(),
defaultMeta: { service: 'account' },
transports: [new winston.transports.Console()]
});
Additional information
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:10 (6 by maintainers)
Top Results From Across the Web
'DefaultMeta' object is not iterable - python - Stack Overflow
I'm following cs50 tutorial lecture04 from which I get the following error. ERROR:- 'DefaultMeta' object is ...
Read more >[3.0.0] Error object is not parsed or printed #1338 - GitHub
Logging a node Error object results in an empty message: ... If it's not an object then it's a string and format.json effectivley...
Read more >A Complete Guide to Winston Logging in Node.js - Better Stack
Learn how to start logging with Winston in Node.js and go from basics to best practices in no time.
Read more >register_meta() | Function - WordPress Developer Resources
Accepts 'post' , 'comment' , 'term' , 'user' , or any other object type with an associated meta table. $meta_key string Required. Meta...
Read more >SQL expression object expected, got object of type <class ...
Interestingly, it works fine without the where() call, or if I use text() ... The error message says it got an object whose...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Me and other students can work on this issue.
@maverick1872 I have upgraded to winston 3.7.2 and it’s same