1 from logging import Formatter 2 3 -class UTF8LogFormatter(Formatter): 4 - def format(self, record): 5 try: 6 return Formatter.format(self, record) 7 except Exception, e: 8 return Formatter.format(self, record).encode('utf8') 9