You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: request_log.rb
    path of file: ./repos/rails_api_logger/lib/rails_api_logger
    
    the code of the file until where you have to start completion: class RequestLog < ActiveRecord::Base
  self.abstract_class = true

  serialize :req
    
  def formatted_body(body)
    if body.is_a?(Hash)
      JSON.pretty_generate(body)
    else
      xml = Nokogiri::XML(body)
      if xml.errors.any?
        body
      else
        xml.to_xml(indent: 2)
      end