Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails 4 app is not writing to production.log , running on Nginx, ubuntu and deployed via capistrano

My app is breaking when customer place an order.

I'm really getting desperate since I need my production.log to figure out what is breaking the app!!

I logged into the :~/mystore/current/log$ nano production.log

And it seems like the production.log haven't been updated since 23/5 2017.

here are the last lines from the production.log

 I, [2017-05-23T11:12:35.067624 #1060]  INFO -- : Completed 404 Not Found in 27ms (ActiveRecord: 3.0ms)
F, [2017-05-23T11:12:35.069957 #1060] FATAL -- :
ActiveRecord::RecordNotFound (Couldn't find Label with 'id'=10):
  app/controllers/labels_controller.rb:21:in `set_label'

Now I can't see why my app is breaking today. Which is strange because I've always been able to monitor the performance through the production.log

this is the settings in the production.rb

  config.log_level = :info

 config.logger = ActiveSupport::Logger.new('/tmp/foo.log') 
 config.logger.info "SMTP_ADDR: #{ENV["SMTP_ADDRESS"].inspect}"
 config.log_formatter = ::Logger::Formatter.new

In the deploy.rb I'm sim-linking, don't know if it has any thing to do with this.

set :linked_files, %w{config/database.yml config/secrets.yml config/application.yml}
set :linked_dirs, %w{log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}

The app is running on Nginx and was deployed via Capistrano Have anyone had this problem? Can someone help me?

Or maybe more important at the moment: Is there another way to see what is Breaking my app?

like image 806
DaudiHell Avatar asked Oct 29 '22 01:10

DaudiHell


1 Answers

I've had similar problem in one of my apps. I couldn't figure the problem out, but then I stumbled upon the concise_logginggem https://github.com/gshaw/concise_logging. And the app started to write to the productionlog.

I would give it a try if I were you. It's very easy to set up and you are ready to go. Also this post can can be handy http://rubyjunky.com/cleaning-up-rails-4-production-logging.html.

like image 104
Slowboy Avatar answered Nov 15 '22 10:11

Slowboy