TSG-8057 Proxy新增公共日志字段common_device_tag

This commit is contained in:
fengweihao
2021-10-18 18:29:10 +08:00
parent ffd2ca6734
commit 665c47295a
5 changed files with 18 additions and 53 deletions

View File

@@ -17,7 +17,7 @@ struct pangu_logger
int entry_id;
unsigned int en_sendlog;
const char *device_id;
const char *data_center;
const char *effective_device_tag;
void* local_logger;
unsigned long long send_cnt;
@@ -59,7 +59,7 @@ struct pangu_logger* pangu_log_handle_create(const char* profile, const char* s
}
instance->device_id = (const char *)tfe_bussiness_resouce_get(DEVICE_ID);
instance->data_center = (const char *)tfe_bussiness_resouce_get(DATA_CENTER);
instance->effective_device_tag = (const char *)tfe_bussiness_resouce_get(EFFECTIVE_DEVICE_TAG);
instance->kafka_logger = (tfe_kafka_logger_t *)tfe_bussiness_resouce_get(KAFKA_LOGGER);
if (instance->kafka_logger && !instance->kafka_logger->enable)
{
@@ -225,9 +225,9 @@ int pangu_send_log(struct pangu_logger* handle, const struct pangu_log* log_msg)
cJSON_AddNumberToObject(common_obj, "common_s2c_byte_num", s2c_byte_num);
cJSON_AddStringToObject(common_obj, "http_url", http->req->req_spec.url);
cJSON_AddStringToObject(common_obj, "http_host", http->req->req_spec.host);
if(handle->data_center)
if(handle->effective_device_tag)
{
cJSON_AddStringToObject(common_obj, "common_data_center", handle->data_center);
cJSON_AddStringToObject(common_obj, "common_device_tag", handle->effective_device_tag);
}
for(size_t i=0;i<sizeof(req_fields)/sizeof(struct json_spec);i++)