Class: RailsLogger

Inherits:
Object
  • Object
show all
Defined in:
lib/loggers/rails_logger.rb

Constant Summary collapse

NEW_LINE =
"\r\n"

Class Method Summary collapse

Class Method Details

.log(severity, message, context, events, metadata) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/loggers/rails_logger.rb', line 7

def self.log(severity, message, context, events, )
  text = build_log_text(severity, message, context, events, )

  logger = ::Rails.logger
  begin
    logger.send(severity.to_s, text)
  rescue
    logger.info(text) # chosen severity might not exist for file logger
  end
end