code: def filter(self, record):
          
  
          def modify(value):
              """
              Modify logged record, truncating it to max length and logging remaining length
              :param value: Record to modify
              :return:
              """
              if isinstance(value, six.string_types):
                  if len(value) < ContextFilter.MAXIMUM_LENGTH:
                      return value
  
                  try:
                      return "{}...[{} more bytes]".format(
                          value[:ContextFilter.REVEAL_LENGTH],
                          len(value) - ContextFilter.REVEAL_LENGTH)
                  except UnicodeError:
                      return "{}...[{} more bytes]".format(
                          repr(value[:ContextFilter.REVEAL_LENGTH]),
                          len(value) - ContextFilter.REVEAL_LENGTH)
              elif isinstance(value, six.binary_type):
                  return "{}...[{} more bytes]".format(
                      repr(value[:ContextFilter.REVEAL_LENGTH]),
                      len(value) - ContextFilter.REVEAL_LENGTH)
  
              else:
                  return value
  
          record.msg = traverse_json_obj(record.msg, callback=modify)
          return True
docs: Filter record
          :param record: Record to filter
          :return: