Hanami: How to disable sql query logs?

Created on 15 May 2019  路  3Comments  路  Source: hanami/hanami

Hi, is there any possibility to disable query logs in stdout on INFO level like:
[bookshelf] [INFO] [2017-02-11 15:42:48 +0100] (0.000381s) SELECT "id", "title", "created_at", "updated_at" FROM "books" WHERE ("book"."id" = '1') ORDER BY "books"."id"

question

Most helpful comment

Just in case anyone else lands here, you can make the sql logger quiet as long as your using the sequel rubygem. Something alone the lines of:

Hanami.configure do
  model do
    adapter :sql, "postgresql://..."

    gateway do |g|
      g.connection.sql_log_level = :debug
    end
  end

  logger level: :info
end

All 3 comments

@mkarganov 馃憢 Hello, there isn't a way to disable SQL logging right now. If this is important to you, please consider to contribute with a PR that introduces this enhancement. Thanks!

Just in case anyone else lands here, you can make the sql logger quiet as long as your using the sequel rubygem. Something alone the lines of:

Hanami.configure do
  model do
    adapter :sql, "postgresql://..."

    gateway do |g|
      g.connection.sql_log_level = :debug
    end
  end

  logger level: :info
end
Was this page helpful?
0 / 5 - 0 ratings