Module: SupplejackApi::Support::ValidationLogger
- Defined in:
- app/models/supplejack_api/support/validation_logger.rb
Class Method Summary collapse
Class Method Details
.logger ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'app/models/supplejack_api/support/validation_logger.rb', line 12 def self.logger logfile = File.open("#{Rails.root}/log/validation.log", 'a') logfile.sync = true # automatically flush data to file @logger ||= Logger.new(logfile) @logger.formatter = proc do |_severity, datetime, _progname, msg| "#{datetime.to_formatted_s(:db)}: #{msg}\n" end @logger end |