Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Production log not working

In the past I thought I was just crazy. I may be, but my production log is not at all responding to some requests. I am POSTing images to my rails app from a mobile client, then GETting a refreshed view in a web browser. The changed record is plainly visible. None of the above is showing up in my production log, but similar requests were logged an hour ago. I haven't changed any config files. I haven't restarted my server. Any suggestions as to why this is happening?

like image 922
Micah Alcorn Avatar asked May 04 '11 03:05

Micah Alcorn


4 Answers

Check what value is set to

config.log_level = :warn

in your

/rails_app/config/enviroments/production.rb

FYI

The available log levels are: :debug, :info, :warn, :error, :fatal.

So if you set the level to fatal only serious errors will be logged. If you set it to debug almost everything will be logged. By default in production it is set to warn. This is with good reason. As you don't want huge log files piling up on your production server for no reason.

like image 138
thekindofme Avatar answered Nov 08 '22 23:11

thekindofme


In my case first i added config.log_level = :debug to production.rb file then i had to create the production.log file (in the log folder), then giving appropriate permissions with chmod command.

like image 25
David Mauricio Avatar answered Nov 08 '22 22:11

David Mauricio


In my case I had the following gem rails_12factor in my Gemfile for production.

So I had to

  1. Remove rails_12factor from my Gemfile
  2. gem uninstall rails_12factor
  3. bundle install

And on the next push to production the logs worked for me. FYI: I am using rails 5.2.1, but the rails web app started in rails 3.

like image 25
schmudu Avatar answered Nov 08 '22 22:11

schmudu


Low memory is the most likely cause that I have been able to come up with. I will post here if I can prove it.

like image 26
Micah Alcorn Avatar answered Nov 08 '22 23:11

Micah Alcorn