Heroku: see params and sql activity in logs?

前端 未结 6 2172
不思量自难忘°
不思量自难忘° 2020-12-07 22:52

When i view my heroku logs on the server (with heroku logs --tail --app myapp) i see something like this:

2011-06-21T14:09:25+00:00 app[web.1]:          


        
6条回答
  •  星月不相逢
    2020-12-07 23:38

    You're essentially wanting to show the SQL / params output in the Heroku logs. You can do this by adding the line shown below to the config block within your production.rb file:

    MyAppNameHere::Application.configure do
    
      # add this line
      config.logger = Logger.new(STDOUT)
    
    end
    

    By the way, setting the log level to debug just means that Rails.logger.debug will output to the logs when you're on Heroku

提交回复
热议问题