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

@@ -286,7 +286,7 @@ int doh_kafka_init(const char *profile, struct doh_conf *conf)
return 0;
}
conf->device_id = (const char *)tfe_bussiness_resouce_get(DEVICE_ID);
conf->data_center = (const char *)tfe_bussiness_resouce_get(DATA_CENTER);
conf->effective_device_tag = (const char *)tfe_bussiness_resouce_get(EFFECTIVE_DEVICE_TAG);
conf->kafka_logger = (tfe_kafka_logger_t *)tfe_bussiness_resouce_get(KAFKA_LOGGER);
if (conf->kafka_logger && !conf->kafka_logger->enable)
{
@@ -406,9 +406,9 @@ int doh_send_log(struct doh_conf *handle, const struct tfe_http_session *http, c
cJSON_AddNumberToObject(common_obj, "common_s2c_byte_num", s2c_byte_num);
cJSON_AddStringToObject(common_obj, "doh_url", http->req->req_spec.url);
cJSON_AddStringToObject(common_obj, "doh_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++)

View File

@@ -59,7 +59,7 @@ struct doh_conf
int entry_id;
int en_sendlog;
const char *device_id;
const char *data_center;
const char *effective_device_tag;
tfe_kafka_logger_t *kafka_logger;
int fs_id[DOH_STAT_MAX];

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++)