Closed PenT1x closed 1 year ago
@PenT1x this is simply how winston (and most logging solutions) work: you specify the lowest priority that should be logged, and the logger logs everything that has either that priority or a higher priority.
If you specify level 'info' for your transport, it will log messages with 'info' level but also 'error' etc. If you specify level 'debug' for your transport, it will log messages with 'debug' level but also 'info', 'error', etc.
From the winston documentation:
winston allows you to define a level property on each transport which specifies the maximum level of messages that a transport should log.
ohhh, okay. So I just put the priorities in the createLogger levels option? Can I like make custom levels by just changing the name ?
@PenT1x you might want to perform a Google search for 'winston log only one level' or similar.
Some sources I found which could be useful:
But in any case, nothing about this is specifically related to winston-mongodb
.
Yes I see that now. This is a little weird for me right now.
🔎 Search Terms
ignoring level, level
The problem
I have set the MongoDB transporter level to debug, but it also saves information with the info level. I thought it would only save things with the debug level.
What version of Winston presents the issue?
winston@3.9.0, winston-mongodb@5.1.1
What version of Node are you using?
v18.12.1
If this worked in a previous version of Winston, which was it?
No response
Minimum Working Example
So I have my logger here
I don't know if this helps but here is the formatter
Additional information
It could also just be me that have misunderstood something.
This is like my first issue on github, so I hope this is right and good enough.