Closed ChrisMiami closed 4 years ago
@ChrisMiami First, I'd like to point out that your configuration appears to duplicate the log files for both transports. Both seem to use the same dirname
and filename
properties. Assuming that's not the issue here, let's move on.
I believe this is working as expected. Consistent with https://github.com/winstonjs/winston#using-logging-levels, the logging level is used to specify the maximum level of messages the transport should log. Since info
is higher than warn
, I'd expect a call to log.warn(...)
to log to both the info_log
and error_log
transports provided in your configuration. However, I'd expect that a call to log.info(...)
to NOT log to your error_log
transport.
I've validated that this works properly on my side - however, if you continue to have problems, don't hesitate to reopen this issue.
Application has 2 DailyRotateFile transports created, one at level: info and one at level: warn. When a log message is written with
log.warn('blabla');
there are 2 lines written to the info file with the exact same timestamp.version: 3.10.0 (presumably still in 4.5.0, since commit messages don't mention fixing it)
Here is my config: