Class: AuthorizationLogger

Inherits:
ActiveSupport::BufferedLogger
  • Object
show all
Defined in:
lib/role_based_authorization/authorization_logger.rb

Overview

Personalizes the authorization logging by adding Auth | in front of each line. It also outputs the time stamp and the severity of the log message.

Constant Summary collapse

AUTHORIZATION_SYSTEM_LOG_MSG_PREFIX =

Prefix for each message

'Auth |'

Instance Method Summary collapse

Instance Method Details

#format_message(severity, timestamp, progname, msg) ⇒ Object

overriding of the formatting message



8
9
10
# File 'lib/role_based_authorization/authorization_logger.rb', line 8

def format_message(severity, timestamp, progname, msg)
    "#{AUTHORIZATION_SYSTEM_LOG_MSG_PREFIX} #{timestamp.to_formatted_s(:db)} #{severity} #{msg}\n" 
end