Class: Train::AuditLog
- Inherits:
-
Object
- Object
- Train::AuditLog
- Defined in:
- lib/train/audit_log.rb
Class Method Summary collapse
-
.create(options = {}) ⇒ Object
Default values for audit log options are set in the options.rb.
Class Method Details
.create(options = {}) ⇒ Object
Default values for audit log options are set in the options.rb
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/train/audit_log.rb', line 4 def self.create( = {}) # Load monkey-patch to disable leading comment in logfiles require_relative "logger_ext" logger = Logger.new([:audit_log_location], [:audit_log_frequency], [:audit_log_size]) logger.level = [:level] || Logger::INFO logger.progname = [:audit_log_app_name] logger.datetime_format = "%Y-%m-%d %H:%M:%S" logger.formatter = proc do |severity, datetime, progname, msg| { timestamp: datetime.to_s, app: progname, }.merge(msg).compact.to_json + $/ end logger end |