Topic: how to supress logging of SET client_min_messages ?

I am running the latest version of rails with pgsql, and I have noticed that at the beginning of every request, development.log gets these 2 lines:
  SQL (0.1ms)   SET client_min_messages TO 'panic'
  SQL (0.1ms)   SET client_min_messages TO 'notice'

This has become unbearable because of a daemon that fetches external data and updates the site every 5 seconds.  I managed to reduce most of the log clutter by overriding the logger method in the controller that receives and processes the data.  But the SQL logging of the above 2 lines remains.  I tried wrapping my code with ActiveRecord::Base.silence blocks but that had no effect.

I think it would be desirable to disable these particular log messages from all requests, but at a minimum I need to get rid of them from the recurring request.  Any suggestions would be appreciated.

Re: how to supress logging of SET client_min_messages ?

I am facing similar problem... Did you find any solution to this problem

Re: how to supress logging of SET client_min_messages ?

to suppress those SQL message I ended up overriding logger.debug within the method that does the query,

    def logger.debug(messages)
    end

It can make real debugging a pain sometimes, too bad there's not a nicer way to suppress those particular messages.

Re: how to supress logging of SET client_min_messages ?

Late into the discussion but given that this post appears as top result in google, here goes how I solved it in my case.

Justs include the following line in your database.yml

min_messages: warning

In my case it was the NOTICE messages while running tests that annoyed me, so I only included this line in the test entry.