code: def format(self, record):
          
          data = record._raw.copy()
  
          # serialize the datetime date as utc string
          data['time'] = data['time'].isoformat()
  
          # stringify exception data
          if data.get('traceback'):
              data['traceback'] = self.formatException(data['traceback'])
  
          return json.dumps(data)
docs: JSON-encode a record for serializing through redis.
  
          Convert date to iso format, and stringify any exceptions.