<commit_before>module MongoDBLogging
  def self.included(base)
    base.class_eval { around_filter :enable_mongo_logging }
  end

  def enable_mongo_logging
    return yield unless Rails.logger.respond_to?(:mongoize)
    
    # make sure the controller knows how to filter its parameters
    f_params = respond_to?(:filter_parameters) ? filter_parameters(params) : params
    Rails.logger.mongoize(:action => action_name, :controller => controller_name, :params => f_params, :ip => request.remote_ip) { yield }
  end
end<commit_msg>record the full URL and the path of the request<commit_after>module MongoDBLogging
  def self.included(base)
    base.class_eval { around_filter :enable_mongo_logging }
  end

  def enable_mongo_logging
    return yield unless Rails.logger.respond_to?(:mongoize)
    
    # make sure the controller knows how to filter its parameters
    f_params = respond_to?(:filter_parameters) ? filter_parameters(params) : params
    Rails.logger.mongoize({
      :action         => action_name,
      :controller     => controller_name,
      :path           => request.path,
      :url            => request.url,
      :params         => f_params,
      :ip             => request.remote_ip
    }) { yield }
  end
end
{'fraction_non_alphanumeric': 0.08716707021791767, 'fraction_numerical': 0.0, 'mean_word_length': 3.2033898305084745, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6238669', 'n_tokens_mistral': 369, 'n_tokens_neox': 362, 'n_words': 91}