lib/heavylog/middleware.rb in heavylog-0.0.22 vs lib/heavylog/middleware.rb in heavylog-0.0.23

- old
+ new

@@ -9,10 +9,12 @@ @sprockets = ::Rails.application.config.respond_to?(:assets) @assets_regex = @sprockets ? %r(\A/{0,2}#{::Rails.application.config.assets.prefix}) : nil end def call(env) - ignore = @sprockets && env["PATH_INFO"] =~ @assets_regex + ignore = (@sprockets && env["PATH_INFO"] =~ @assets_regex) || + (Heavylog.ignore_path && env["PATH_INFO"] =~ Heavylog.ignore_path) + unless ignore request = ActionDispatch::Request.new(env) RequestStore.store[:heavylog_request_id] = request.uuid RequestStore.store[:heavylog_request_start] = Time.now.iso8601 RequestStore.store[:heavylog_request_ip] = request.ip