Way to disable Rails SQL logs?

后端 未结 3 758
清歌不尽
清歌不尽 2021-02-09 15:15

Is there a way to disable SQL logs in Rails, other than changing the log level? I\'ve got some logger.debug statements that I\'d like to print out in my ActiveRecord models, but

3条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-09 16:10

    Dan,

    Is this in production or development mode? If it's development mode this is usually what I do:

    logger.info("DEBUG my message here")
    logger.info("DEBUG #{my_object.inspect}")
    
    tail -f log/development | grep DEBUG
    

提交回复
热议问题