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