def _getjsondata(self,record):
        """ combines any supplied recordfields with the log record msg field into an object to convert to JSON 
        
            Args:
                record   : log record to output to JSON log               
            Returns:
                An object to convert to JSON - either an ordered dict if recordfields are supplied or the record.msg attribute
        """
        if (len(self.recordfields)>0):
            fields = []
            for x in self.recordfields:
                fields.append((x,getattr(record,x)))
            fields.append(('msg',record.msg))
            # An OrderedDict is used to ensure that the converted data appears in the same order for every record
            return OrderedDict(fields)
        else:
            return record.msg
 combines any supplied recordfields with the log record msg field into an object to convert to JSON 
        
            Args:
                record   : log record to output to JSON log               
            Returns:
                An object to convert to JSON - either an ordered dict if recordfields are supplied or the record.msg attribute
        
recipes/Python/580667_JSON_Formatted_Logging/recipe-580667.py