Update the logger creation to override level priorities #129
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While using the library and integrating with external logging tooling like Seq and CloudWatch we ran into some issues with confusion over the logging levels.
The issues related to setting certainly logging levels and then logging at certain levels not appearing when expected. The friction turned out to be related to winstonjs' default logging level priorities. With the default priorities
debug
is more verbose thanverbose
, which was not expected and not in line with the expectations of the filtering in Seq, CloudWatch etc.winstonjs does allow overriding the level priorities though, so this PR changes the default we use when configuring the logger. The options still allow the consumer to override it if they need to.
Also, as part of writing the tests I discovered that there was a
transports
property at the root level of the options but also on theloggerOptions
, which comes from winstonjs itself. The one at the root level of the options is the one you must specify in order to get the correct config, soOmit
has been added to the lower level on the interface we expose to prevent callers accidentally using the wrong one and getting unexpected behaviour.