Sidekiq: How to limit size of sidekiq log?

Created on 12 Apr 2016  路  6Comments  路  Source: mperham/sidekiq

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]

Most helpful comment

If your logs are too verbose, you could set the logging level higher:

# config/initializers/sidekiq.rb
Sidekiq::Logging.logger.level = Logger::WARN

All 6 comments

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)
Was this page helpful?
0 / 5 - 0 ratings

Related issues

sandstrom picture sandstrom  路  3Comments

edgarjs picture edgarjs  路  3Comments

paul-ylz picture paul-ylz  路  4Comments

bartimaeus picture bartimaeus  路  3Comments

HenleyChiu picture HenleyChiu  路  4Comments