-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
defaultMeta ignored when using logger.log function but not in logger[level] functions #1759
Comments
I ran into the same issue. I believe this issue is related to this line: Line 223 in 73ae01f
|
I have the same issue. |
Still the same on 3.3.3 |
Using 3.3.3 we get the following... const logger = winston.createLogger({
level: "debug",
defaultMeta: {
meta: {
client: { name, version }
}
},
transports: [new winston.transports.Console()]
});
logger.log('error', 'Error message');
// {"level":"error","message":"Error message"}
logger.error('Error message');
// {"level":"error","message":"Error message","meta":{"client":{"name":"james-bond","version":"0.0.7"}}} |
Same happening with profiling, the So is this actually an issue or the expected behavior? |
Possibly related to #2029 |
Introduced the above example as a test case in #1989 and have verified this is functioning as we would expect. As such I will be closing this issue and letting the master issue track this issue. |
Please tell us about your environment:
winston
version?winston@2
winston@3
3.2.1node -v
outputs: v13.5.0What is the problem?
When calling the function
logger.log('debug', 'message')
it seems to completely ignoredefaultMeta
, but calling functions likelogger.debug
does notMy createLogger
What do you expect to happen instead?
Given my createLogger setup above I expect both
AND
to both print out this to the console:
However the latter (
logger.log
) prints thisOther information
The text was updated successfully, but these errors were encountered: