I have a rails app with sidekiq. Sidekiq writes log in log/sidekiq.log and I have a such config:
:concurrency: 10
:logfile: ./log/sidekiq.log
:queues:
- [import, 10]
- [utils, 10]
- [cache, 1]
- [notify, 1]
What do you mean by limit the log ?
limit of size log
You can use logrotate for that.
How to use it? In my Rails app I could do just this: ActiveSupport::Logger.new(config.paths['log'].first, 1, 100_000_00)
If your logs are too verbose, you could set the logging level higher:
# config/initializers/sidekiq.rb
Sidekiq::Logging.logger.level = Logger::WARN
You can do this but @seuros is right, logrotate is the correct solution.
Sidekiq::Logging.logger = ActiveSupport::Logger.new(config.paths['log'].first, 1, 100_000_00)
Most helpful comment
If your logs are too verbose, you could set the logging level higher: