feature: TSG-8451 Proxy增加HOS非格式化日志发送开关
This commit is contained in:
@@ -4,6 +4,7 @@ enable_plugin=1
|
||||
[log]
|
||||
entrance_id=0
|
||||
# default 1, if enable "en_sendlog", the iterm "tfe.conf [kafka] enable" must set 1
|
||||
en_hoslog=1
|
||||
en_sendlog=1
|
||||
|
||||
#Addresses of hos, Bucket name in hos. Format is defined by WiredLB.
|
||||
|
||||
@@ -15,6 +15,7 @@ struct json_spec
|
||||
struct pangu_logger
|
||||
{
|
||||
int entry_id;
|
||||
unsigned int en_hoslog;
|
||||
unsigned int en_sendlog;
|
||||
const char *device_id;
|
||||
const char *effective_device_tag;
|
||||
@@ -50,6 +51,7 @@ struct pangu_logger* pangu_log_handle_create(const char* profile, const char* s
|
||||
|
||||
TFE_LOG_INFO(local_logger,"Pangu log is inititating from %s section %s.", profile, section);
|
||||
MESA_load_profile_int_def(profile, section, "ENTRANCE_ID",&(instance->entry_id),0);
|
||||
MESA_load_profile_uint_def(profile, section, "en_hoslog", &instance->en_hoslog, 1);
|
||||
MESA_load_profile_uint_def(profile, section, "en_sendlog", &instance->en_sendlog, 1);
|
||||
TFE_LOG_INFO(local_logger, "Pangu sendlog : %s", instance->en_sendlog ? "ENABLE" : "DISABLE");
|
||||
|
||||
@@ -67,6 +69,8 @@ struct pangu_logger* pangu_log_handle_create(const char* profile, const char* s
|
||||
goto error_out;
|
||||
}
|
||||
|
||||
if(instance->en_hoslog==1)
|
||||
{
|
||||
log_file_upload_para=cache_evbase_parameter_new(profile, section, local_logger);
|
||||
if (log_file_upload_para == NULL)
|
||||
{
|
||||
@@ -74,6 +78,7 @@ struct pangu_logger* pangu_log_handle_create(const char* profile, const char* s
|
||||
goto error_out;
|
||||
}
|
||||
instance->log_file_upload_instance=cache_evbase_instance_new(log_file_upload_para, local_logger);
|
||||
}
|
||||
return instance;
|
||||
|
||||
error_out:
|
||||
@@ -260,6 +265,11 @@ int pangu_send_log(struct pangu_logger* handle, const struct pangu_log* log_msg)
|
||||
continue;
|
||||
}
|
||||
|
||||
if(handle->en_hoslog!=1)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
struct tango_cache_meta_put meta;
|
||||
char* log_file_key=NULL;;
|
||||
const char* cont_type_val;
|
||||
|
||||
Reference in New Issue
Block a user