vendredi 3 février 2017

How to create a log folder before rails application loads the config

  1. I have an rails app. I am using Jruby/Warble/Jetty to create the executable war file. Copy paste the war file into a separate folder.
  2. I want the application to log outside the war file. So i am using the solution from this LINK

3.

config.logger = ActiveSupport::BufferedLogger.new(File.join(ENV['RAILS_ENV'], "#{Rails.root}/logs/#{ENV['RAILS_ENV']}.log"))

  1. When the rails server boots up. It says "Automatic creation of logging directories has been deprecated in rails". SEE Kevin Bedell Answer

How do I create a folder when the rails application starts so that the folder is created when the application boots up and the logs can access the created folder. Thank you.

Aucun commentaire:

Enregistrer un commentaire