Introduce log_dir env variable for truemail and require it with figaro.

Use log_dir in truemail initializer.
This commit is contained in:
Georg Kahest 2020-07-17 04:00:17 +03:00 committed by Alex Sherman
parent 481bb34e67
commit 76eed1ef08
3 changed files with 5 additions and 1 deletions

View file

@ -4,6 +4,9 @@
#
# Be sure to restart your server when you modify settings.
#
# Log directory for gems not using syslog
log_dir: /home/app/current/log
#
# SMTP configuration (for Admin/EPP/Registrar/Registrant servers)

View file

@ -5,4 +5,5 @@ Figaro.require_keys(%w[
time_zone
action_mailer_default_host
action_mailer_default_from
log_dir
])

View file

@ -72,6 +72,6 @@ Truemail.configure do |config|
# stdout, write to file or both of these. Tracking event by default is :error
# Available tracking event: :all, :unrecognized_error, :recognized_error, :error
unless Rails.env.test?
config.logger = { tracking_event: :all, stdout: true, log_absolute_path: Rails.root.join('log', 'truemail.log') }
config.logger = { tracking_event: :all, stdout: true, log_absolute_path: "#{ENV['log_dir']}/truemail.log" }
end
end