Sidekiq: Sidekiq.logger = nil does not work in 6.0

Created on 3 Sep 2019  路  4Comments  路  Source: mperham/sidekiq

Ruby version: 2.6.3
Sidekiq / Pro / Enterprise version(s): 6.0, 5.0, 2.0

Setting Sidekiq.logger = nil doesn't appear to stop logging anymore.
https://github.com/mperham/sidekiq/wiki/Logging#turning-off-logging-in-the-test-environment

What is the recommended way to disable logging in test env now?

Most helpful comment

6.0.1 will automatically set level to FATAL if nil is passed in since a nil logger is not technically supported. Thanks for the feedback!

All 4 comments

Do you think it's better to disable it completely or set the level to ERROR or FATAL? Wouldn't you want tests to log errors?

I've adjusted the documentation to show how to set the level to ERROR. I think that's a better way to see less log output.

In our tests, sometimes we specifically test scenarios that trigger logger.error and I prefer those logs to not appear in our test output.

I've gone with setting the log level to FATAL for our test env which generally solves the issue.

Thanks!

6.0.1 will automatically set level to FATAL if nil is passed in since a nil logger is not technically supported. Thanks for the feedback!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

andrewhavens picture andrewhavens  路  4Comments

mperham picture mperham  路  4Comments

homanchou picture homanchou  路  3Comments

edgarjs picture edgarjs  路  3Comments

agrobbin picture agrobbin  路  4Comments