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?
I've had similar problem in one of my apps. I couldn't figure the problem out, but then I stumbled upon the concise_logging
gem https://github.com/gshaw/concise_logging.
And the app started to write to the production
log.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With