Class: AuditedLogfile::ActiveRecord::LogSubscriber
- Inherits:
-
ActiveSupport::LogSubscriber
- Object
- ActiveSupport::LogSubscriber
- AuditedLogfile::ActiveRecord::LogSubscriber
- Defined in:
- lib/audited_logfile.rb
Instance Method Summary collapse
Instance Method Details
#sql(event) ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/audited_logfile.rb', line 31 def sql(event) if event.payload[:sql] =~ /\ASELECT/i user = Thread.current[:sql_audit_user] user_info = user ? "#{user.class}(#{user.id}): #{user.try(:email)}" : 'Unknown' AuditedLogfile.logger.info "#{Time.now.iso8601(1)}, SELECT, #{user_info}, `#{event.payload[:sql]}`" end end |