#NEWLINE# def jsonify( self , record ) : #NEWLINE# #INDENT# '\n        Translate a LogRecord instance into a json_event\n        ' #NEWLINE# timestamp = datetime . utcfromtimestamp ( record . created ) #NEWLINE# timestamp = timestamp . isoformat ( ) #NEWLINE# fields = { #NEWLINE# #INDENT# 'level' : record . levelname , #NEWLINE# 'filename' : record . pathname , #NEWLINE# 'lineno' : record . lineno , #NEWLINE# 'method' : record . funcName , #NEWLINE# #UNINDENT# } #NEWLINE# if record . exc_info : #NEWLINE# #INDENT# fields [ 'exception' ] = str ( record . exc_info ) #NEWLINE# fields [ 'traceback' ] = format_exc ( record . exc_info ) #NEWLINE# #UNINDENT# log = { #NEWLINE# #INDENT# '@source_host' : self . hostname , #NEWLINE# '@timestamp' : timestamp , #NEWLINE# '@tags' : [ record . name ] , #NEWLINE# '@message' : record . getMessage ( ) , #NEWLINE# '@fields' : fields , #NEWLINE# #UNINDENT# } #NEWLINE# return json . dumps ( log )