Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to rotate, override, or turn off logging from Sunspot Solr Rubygem?

I've had great experiences with Sunspot Solr search for Ruby on Rails, however, its log files are growing incredibly large and I can't seem to find a way to either rotate, override, or turn off these logs (other than with very hacky methods that I'd rather not pursue).

I have a file, sunspot.yml in config/, where I tried setting the log_level flags to SEVERE, however, this had no effect.

I tried using the standard Logger.config rotation methods, however, that just sent my development log output to newly created files.

I would greatly appreciate any suggestions you can offer.

like image 427
lightyrs Avatar asked Feb 12 '11 03:02

lightyrs


2 Answers

It's a bit late, but looks like this is now handled inside config/sunspot.yml:

production:
  solr:
    hostname: thorn
    port: 8983
    log_level: WARNING
    min_memory: 512M
    max_memory: 1G
    solr_home: /u/solr
like image 90
Kevin Avatar answered Sep 19 '22 10:09

Kevin


In the console, this turns off all logging for me:

Sunspot::Rails::LogSubscriber.logger.level = 4
ActiveRecord::Base.logger.level = 4
Rails.logger.level = 4

My Gem versions:

  • sunspot (2.0.0.pre.130115)
  • sunspot_rails (2.0.0.pre.130115)
  • sunspot_solr (2.0.0.pre.130115)
like image 44
Leslie Viljoen Avatar answered Sep 21 '22 10:09

Leslie Viljoen