#NEWLINE# def _set_syslog_handler( self , log , cfg , fmt , name ) : #NEWLINE# #INDENT# if ( not cfg . syslog_prefix ) : #NEWLINE# #INDENT# prefix = cfg . proc_name . replace ( ':' , '.' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# prefix = cfg . syslog_prefix #NEWLINE# #UNINDENT# prefix = ( 'gunicorn.%s.%s' % ( prefix , name ) ) #NEWLINE# fmt = logging . Formatter ( ( '%s: %s' % ( socktype , fmt ) ) ) #NEWLINE# try : #NEWLINE# #INDENT# facility = SYSLOG_FACILITIES [ cfg . syslog_facility . lower ( ) ] #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# raise RuntimeError ( 'unknown facility name' ) #NEWLINE# #UNINDENT# ( socktype , addr ) = parse_syslog_address ( cfg . syslog_addr ) #NEWLINE# if ( sys . version_info >= ( 2 , 7 ) ) : #NEWLINE# #INDENT# h = logging . handlers . SysLogHandler ( address = addr , facility = facility , socktype = socktype ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# h = logging . handlers . SysLogHandler ( address = addr , facility = facility ) #NEWLINE# #UNINDENT# h . setFormatter ( fmt ) #NEWLINE# h . _gunicorn = True #NEWLINE# log . addHandler ( h )