Skip to content
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

Update the logger creation to override level priorities #129

Merged
merged 5 commits into from
Feb 13, 2024

Conversation

slewis74
Copy link
Contributor

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 than verbose, 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 the loggerOptions, 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, so Omit has been added to the lower level on the interface we expose to prevent callers accidentally using the wrong one and getting unexpected behaviour.

@tristanmenzel tristanmenzel merged commit c832560 into main Feb 13, 2024
1 check passed
@slewis74 slewis74 deleted the feature/default_levels branch February 14, 2024 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants