Forum Discussion

Lucas915's avatar
Lucas915
Copper Contributor
Oct 05, 2022

Missing Operation ID and name

We'd like to customize out log format, so we have a method to get the logger.

However, when we use the logger, we found that the operation_Name and operation_Id disappeared. We'd like to know why the operation_Name and operation_Id disappear and how to make it show on the query result.

 

Here' the sample code to get logger:

 

FORMAT = json.dumps(

{ 'loggerName': '%(name)s',

'funcName': '%(funcName)s',

'message': '%(message)s',

'asctime': '%(asctime)s',

'level': '%(levelname)s', } )

 

def get_customized_json_logger(logger_name):

logger = logging.getLogger(logger_name)

logger.setLevel(logging.INFO)

log_handler = logging.StreamHandler()

log_handler.setLevel(logging.INFO)

formatter = logging.Formatter(FORMAT)

log_handler.setFormatter(formatter) logger.addHandler(log_handler) return logger

No RepliesBe the first to reply