77
88# The list contains all the attributes listed in that will not be overwritten by custom extra props
99# http://docs.python.org/library/logging.html#logrecord-attributes
10- RECORD_ATTR_SKIP_LIST = [
10+ LOG_RECORD_BUILT_IN_ATTRS = [
1111 'asctime' , 'created' , 'exc_info' , 'exc_text' , 'filename' , 'args' ,
1212 'funcName' , 'id' , 'levelname' , 'levelno' , 'lineno' , 'module' , 'msg' ,
1313 'msecs' , 'msecs' , 'message' , 'name' , 'pathname' , 'process' ,
2525if sys .version_info < (3 , 0 ):
2626 EASY_SERIALIZABLE_TYPES = (basestring , bool , dict , float , int , list , type (None ))
2727else :
28- RECORD_ATTR_SKIP_LIST .append ('stack_info' )
28+ LOG_RECORD_BUILT_IN_ATTRS .append ('stack_info' )
2929 EASY_SERIALIZABLE_TYPES = (str , bool , dict , float , int , list , type (None ))
3030
3131
@@ -86,7 +86,7 @@ def _get_extra_fields(self, record):
8686 fields ['msg' ] = record .msg
8787
8888 for key , value in record .__dict__ .items ():
89- if key not in RECORD_ATTR_SKIP_LIST :
89+ if key not in LOG_RECORD_BUILT_IN_ATTRS :
9090 if isinstance (value , EASY_SERIALIZABLE_TYPES ):
9191 fields [key ] = value
9292 else :
@@ -150,6 +150,7 @@ def _format_log_object(self, record, request_util):
150150 json_log_object .update ({
151151 "correlation_id" : request_util .get_correlation_id (within_formatter = True ),
152152 })
153+
153154 return json_log_object
154155
155156
@@ -162,7 +163,7 @@ def _format_log_object(self, record, request_util):
162163 json_log_object = super (JSONRequestLogFormatter , self )._format_log_object (record , request_util )
163164
164165 request_adapter = request_util .request_adapter
165- response_adapter = json_logging . _request_util .response_adapter
166+ response_adapter = request_util .response_adapter
166167
167168 request = record .request_response_data ._request
168169 response = record .request_response_data ._response
0 commit comments