Disable logging for any model updates in Rails?

55 views
Skip to first unread message

mrmanishs

unread,
Nov 23, 2009, 11:33:38 PM11/23/09
to Thinking Sphinx
How can I disable logging for any model updates with Rails and
Thinking Sphinx?

Pat Allan

unread,
Nov 25, 2009, 12:09:31 AM11/25/09
to thinkin...@googlegroups.com
Unfortunately there's no way to turn off any of Thinking Sphinx's
logging currently (well, beyond changing the overall logging level).
This matches ActiveRecord's behaviour, so not sure if I want to change
it... open to discussion though :)

--
Pat

On 24/11/2009, at 3:33 PM, mrmanishs wrote:

> How can I disable logging for any model updates with Rails and
> Thinking Sphinx?
>
> --
>
> You received this message because you are subscribed to the Google
> Groups "Thinking Sphinx" group.
> To post to this group, send email to thinkin...@googlegroups.com.
> To unsubscribe from this group, send email to thinking-sphi...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/thinking-sphinx?hl=en
> .
>
>

mrmanishs

unread,
Dec 13, 2009, 10:46:26 PM12/13/09
to Thinking Sphinx
Sorry I didn't reply sooner...

I set my log level in environments/production.rb to :fatal, but it
still is logging all indexing activity. Any other way to disable it?

I think it would be nice to have a flag to spit out logs or not,
because it may be easier to remove any unneeded noise during debugging
issues.

Manish

mrmanishs

unread,
Dec 13, 2009, 10:53:17 PM12/13/09
to Thinking Sphinx
Oh one more thing, this is the indexing log in error.log in my nginx
file. It looks like this:

collected 3 docs, 0.0 MB
collected 0 attr values
sorted 0.0 Mvalues, 100.0% done
sorted 0.0 Mhits, 100.0% done
total 3 docs, 520 bytes
total 0.014 sec, 35842 bytes/sec, 206.78 docs/sec
total 8 reads, 0.000 sec, 9.6 kb/call avg, 0.0 msec/call avg
total 12 writes, 0.000 sec, 2.9 kb/call avg, 0.0 msec/call avg
rotating indices: succesfully sent SIGHUP to searchd (pid=13705).

Manish

Pat Allan

unread,
Dec 13, 2009, 11:08:28 PM12/13/09
to thinkin...@googlegroups.com
Ah, I misunderstood... you want the delta outputs muted? That's easy enough (albeit not really documented). Add the following to your environment.rb:

ThinkingSphinx.suppress_delta_output = true if RAILS_ENV == 'production'

You can't put it in production.rb, because Thinking Sphinx isn't loaded then, and so Rails will load TS twice, the first time when you attempt to set the value, again when plugins/gems are initialised (and thus overwriting your custom value).

Cheers

--
Pat

Manish M. Shah

unread,
Dec 13, 2009, 11:11:49 PM12/13/09
to thinkin...@googlegroups.com
Sweet... thanks!

SupaIrish

unread,
Jan 12, 2010, 3:35:37 PM1/12/10
to Thinking Sphinx
This was driving me crazy too, thanks!
Reply all
Reply to author
Forward
0 new messages