Module | PhusionPassenger::ClassicRailsExtensions::AnalyticsLogging::ARAbstractAdapterExtension
In: | lib/phusion_passenger/classic_rails_extensions/analytics_logging/ar_abstract_adapter_extension.rb

### Methods

log_with_passenger

### Protected Instance methods

log_with_passenger(sql, name, &block)

[Source]

        # File lib/phusion_passenger/classic_rails_extensions/analytics_logging/ar_abstract_adapter_extension.rb, line 33
    33:         def log_with_passenger(sql, name, &block)
    34:                 # Log SQL queries and durations.
    35:                 log = Thread.current[PASSENGER_ANALYTICS_WEB_LOG]
    36:                 if log
    37:                         if name
    38:                                 name = name.strip
    39:                         else
    40:                                 name = "SQL"
    41:                         end
    42:                         digest = Digest::MD5.hexdigest("#{name}\0#{sql}\0#{rand}")
    43:                         log.measure("DB BENCHMARK: #{digest}", "#{name}\n#{sql}") do
    44:                                 log_without_passenger(sql, name, &block)
    45:                         end
    46:                 else
    47:                         log_without_passenger(sql, name, &block)
    48:                 end
    49:         end

[Validate]