add parameter compress_error_log_days_before
parent
634d85eaae
commit
46171f2c64
2
HISTORY
2
HISTORY
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
Version 6.04 2019-11-30
|
Version 6.04 2019-12-01
|
||||||
* storage_report_ip_changed ignore result EEXIST
|
* storage_report_ip_changed ignore result EEXIST
|
||||||
* use get_gzip_command_filename from libfastcommon v1.42
|
* use get_gzip_command_filename from libfastcommon v1.42
|
||||||
* support compress error log and access log
|
* support compress error log and access log
|
||||||
|
|
|
||||||
|
|
@ -260,6 +260,10 @@ access_log_rotate_time=00:00
|
||||||
# since V6.04
|
# since V6.04
|
||||||
compress_old_access_log = false
|
compress_old_access_log = false
|
||||||
|
|
||||||
|
# compress the access log days before
|
||||||
|
# default value is 1
|
||||||
|
compress_access_log_days_before = 1
|
||||||
|
|
||||||
# if rotate the error log every day
|
# if rotate the error log every day
|
||||||
# default value is false
|
# default value is false
|
||||||
# since V4.02
|
# since V4.02
|
||||||
|
|
@ -276,6 +280,10 @@ error_log_rotate_time=00:00
|
||||||
# since V6.04
|
# since V6.04
|
||||||
compress_old_error_log = false
|
compress_old_error_log = false
|
||||||
|
|
||||||
|
# compress the error log days before
|
||||||
|
# default value is 1
|
||||||
|
compress_error_log_days_before = 1
|
||||||
|
|
||||||
# rotate access log when the log file exceeds this size
|
# rotate access log when the log file exceeds this size
|
||||||
# 0 means never rotates log file by log file size
|
# 0 means never rotates log file by log file size
|
||||||
# default value is 0
|
# default value is 0
|
||||||
|
|
|
||||||
|
|
@ -247,6 +247,10 @@ error_log_rotate_time = 00:00
|
||||||
# since V6.04
|
# since V6.04
|
||||||
compress_old_error_log = false
|
compress_old_error_log = false
|
||||||
|
|
||||||
|
# compress the error log days before
|
||||||
|
# default value is 1
|
||||||
|
compress_error_log_days_before = 1
|
||||||
|
|
||||||
# rotate error log when the log file exceeds this size
|
# rotate error log when the log file exceeds this size
|
||||||
# 0 means never rotates log file by log file size
|
# 0 means never rotates log file by log file size
|
||||||
# default value is 0
|
# default value is 0
|
||||||
|
|
|
||||||
|
|
@ -1998,17 +1998,24 @@ int storage_func_init(const char *filename, \
|
||||||
&iniContext, false);
|
&iniContext, false);
|
||||||
g_compress_old_error_log = iniGetBoolValue(NULL, "compress_old_error_log",
|
g_compress_old_error_log = iniGetBoolValue(NULL, "compress_old_error_log",
|
||||||
&iniContext, false);
|
&iniContext, false);
|
||||||
|
g_compress_error_log_days_before = iniGetIntValue(NULL,
|
||||||
|
"compress_error_log_days_before", &iniContext, 1);
|
||||||
|
g_compress_access_log_days_before = iniGetIntValue(NULL,
|
||||||
|
"compress_access_log_days_before", &iniContext, 1);
|
||||||
|
|
||||||
if (g_compress_old_error_log)
|
if (g_compress_old_error_log)
|
||||||
{
|
{
|
||||||
log_set_compress_log_flags(LOG_COMPRESS_FLAGS_ENABLED |
|
log_set_compress_log_flags(LOG_COMPRESS_FLAGS_ENABLED |
|
||||||
LOG_COMPRESS_FLAGS_NEW_THREAD);
|
LOG_COMPRESS_FLAGS_NEW_THREAD);
|
||||||
|
log_set_compress_log_days_before(g_compress_error_log_days_before);
|
||||||
}
|
}
|
||||||
if (g_use_access_log && g_compress_old_access_log)
|
if (g_use_access_log && g_compress_old_access_log)
|
||||||
{
|
{
|
||||||
log_set_compress_log_flags_ex(&g_access_log_context,
|
log_set_compress_log_flags_ex(&g_access_log_context,
|
||||||
LOG_COMPRESS_FLAGS_ENABLED |
|
LOG_COMPRESS_FLAGS_ENABLED |
|
||||||
LOG_COMPRESS_FLAGS_NEW_THREAD);
|
LOG_COMPRESS_FLAGS_NEW_THREAD);
|
||||||
|
log_set_compress_log_days_before_ex(&g_access_log_context,
|
||||||
|
g_compress_access_log_days_before);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((result=get_time_item_from_conf(&iniContext, \
|
if ((result=get_time_item_from_conf(&iniContext, \
|
||||||
|
|
@ -2142,9 +2149,11 @@ int storage_func_init(const char *filename, \
|
||||||
"use_access_log=%d, rotate_access_log=%d, " \
|
"use_access_log=%d, rotate_access_log=%d, " \
|
||||||
"access_log_rotate_time=%02d:%02d, " \
|
"access_log_rotate_time=%02d:%02d, " \
|
||||||
"compress_old_access_log=%d, " \
|
"compress_old_access_log=%d, " \
|
||||||
|
"compress_access_log_days_before=%d, " \
|
||||||
"rotate_error_log=%d, " \
|
"rotate_error_log=%d, " \
|
||||||
"error_log_rotate_time=%02d:%02d, " \
|
"error_log_rotate_time=%02d:%02d, " \
|
||||||
"compress_old_error_log=%d, " \
|
"compress_old_error_log=%d, " \
|
||||||
|
"compress_error_log_days_before=%d, " \
|
||||||
"rotate_access_log_size=%"PRId64", " \
|
"rotate_access_log_size=%"PRId64", " \
|
||||||
"rotate_error_log_size=%"PRId64", " \
|
"rotate_error_log_size=%"PRId64", " \
|
||||||
"log_file_keep_days=%d, " \
|
"log_file_keep_days=%d, " \
|
||||||
|
|
@ -2183,8 +2192,10 @@ int storage_func_init(const char *filename, \
|
||||||
g_http_port, g_http_domain, g_use_access_log, \
|
g_http_port, g_http_domain, g_use_access_log, \
|
||||||
g_rotate_access_log, g_access_log_rotate_time.hour, \
|
g_rotate_access_log, g_access_log_rotate_time.hour, \
|
||||||
g_access_log_rotate_time.minute, g_compress_old_access_log, \
|
g_access_log_rotate_time.minute, g_compress_old_access_log, \
|
||||||
|
g_compress_access_log_days_before, \
|
||||||
g_rotate_error_log, g_error_log_rotate_time.hour, \
|
g_rotate_error_log, g_error_log_rotate_time.hour, \
|
||||||
g_error_log_rotate_time.minute, g_compress_old_error_log, \
|
g_error_log_rotate_time.minute, g_compress_old_error_log, \
|
||||||
|
g_compress_error_log_days_before, \
|
||||||
g_access_log_context.rotate_size, \
|
g_access_log_context.rotate_size, \
|
||||||
g_log_context.rotate_size, g_log_file_keep_days, \
|
g_log_context.rotate_size, g_log_file_keep_days, \
|
||||||
g_file_sync_skip_invalid_record, \
|
g_file_sync_skip_invalid_record, \
|
||||||
|
|
|
||||||
|
|
@ -126,6 +126,8 @@ char g_exe_name[256] = {0};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int g_log_file_keep_days = 0;
|
int g_log_file_keep_days = 0;
|
||||||
|
int g_compress_access_log_days_before = 0;
|
||||||
|
int g_compress_error_log_days_before = 0;
|
||||||
struct storage_nio_thread_data *g_nio_thread_data = NULL;
|
struct storage_nio_thread_data *g_nio_thread_data = NULL;
|
||||||
struct storage_dio_thread_data *g_dio_thread_data = NULL;
|
struct storage_dio_thread_data *g_dio_thread_data = NULL;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -175,6 +175,8 @@ extern char g_exe_name[256];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern int g_log_file_keep_days;
|
extern int g_log_file_keep_days;
|
||||||
|
extern int g_compress_access_log_days_before;
|
||||||
|
extern int g_compress_error_log_days_before;
|
||||||
|
|
||||||
extern struct storage_nio_thread_data *g_nio_thread_data; //network io thread data
|
extern struct storage_nio_thread_data *g_nio_thread_data; //network io thread data
|
||||||
extern struct storage_dio_thread_data *g_dio_thread_data; //disk io thread data
|
extern struct storage_dio_thread_data *g_dio_thread_data; //disk io thread data
|
||||||
|
|
|
||||||
|
|
@ -583,10 +583,13 @@ int tracker_load_from_conf_file(const char *filename, \
|
||||||
&iniContext, false);
|
&iniContext, false);
|
||||||
g_compress_old_error_log = iniGetBoolValue(NULL, "compress_old_error_log",
|
g_compress_old_error_log = iniGetBoolValue(NULL, "compress_old_error_log",
|
||||||
&iniContext, false);
|
&iniContext, false);
|
||||||
|
g_compress_error_log_days_before = iniGetIntValue(NULL,
|
||||||
|
"compress_error_log_days_before", &iniContext, 1);
|
||||||
if (g_compress_old_error_log)
|
if (g_compress_old_error_log)
|
||||||
{
|
{
|
||||||
log_set_compress_log_flags(LOG_COMPRESS_FLAGS_ENABLED |
|
log_set_compress_log_flags(LOG_COMPRESS_FLAGS_ENABLED |
|
||||||
LOG_COMPRESS_FLAGS_NEW_THREAD);
|
LOG_COMPRESS_FLAGS_NEW_THREAD);
|
||||||
|
log_set_compress_log_days_before(g_compress_error_log_days_before);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((result=get_time_item_from_conf(&iniContext, \
|
if ((result=get_time_item_from_conf(&iniContext, \
|
||||||
|
|
@ -753,6 +756,7 @@ int tracker_load_from_conf_file(const char *filename, \
|
||||||
"rotate_error_log=%d, " \
|
"rotate_error_log=%d, " \
|
||||||
"error_log_rotate_time=%02d:%02d, " \
|
"error_log_rotate_time=%02d:%02d, " \
|
||||||
"compress_old_error_log=%d, " \
|
"compress_old_error_log=%d, " \
|
||||||
|
"compress_error_log_days_before=%d, " \
|
||||||
"rotate_error_log_size=%"PRId64", " \
|
"rotate_error_log_size=%"PRId64", " \
|
||||||
"log_file_keep_days=%d, " \
|
"log_file_keep_days=%d, " \
|
||||||
"store_slave_file_use_link=%d, " \
|
"store_slave_file_use_link=%d, " \
|
||||||
|
|
@ -790,6 +794,7 @@ int tracker_load_from_conf_file(const char *filename, \
|
||||||
g_storage_ids_by_id.count, g_storage_ids_by_ip.count, \
|
g_storage_ids_by_id.count, g_storage_ids_by_ip.count, \
|
||||||
g_rotate_error_log, g_error_log_rotate_time.hour, \
|
g_rotate_error_log, g_error_log_rotate_time.hour, \
|
||||||
g_error_log_rotate_time.minute, g_compress_old_error_log, \
|
g_error_log_rotate_time.minute, g_compress_old_error_log, \
|
||||||
|
g_compress_error_log_days_before, \
|
||||||
g_log_context.rotate_size, g_log_file_keep_days,
|
g_log_context.rotate_size, g_log_file_keep_days,
|
||||||
g_store_slave_file_use_link, \
|
g_store_slave_file_use_link, \
|
||||||
g_use_connection_pool, g_connection_pool_max_idle_time);
|
g_use_connection_pool, g_connection_pool_max_idle_time);
|
||||||
|
|
|
||||||
|
|
@ -75,5 +75,6 @@ char g_exe_name[256] = {0};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int g_log_file_keep_days = 0;
|
int g_log_file_keep_days = 0;
|
||||||
|
int g_compress_error_log_days_before = 0;
|
||||||
FDFSConnectionStat g_connection_stat = {0, 0};
|
FDFSConnectionStat g_connection_stat = {0, 0};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -99,6 +99,7 @@ extern char g_exe_name[256];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern int g_log_file_keep_days;
|
extern int g_log_file_keep_days;
|
||||||
|
extern int g_compress_error_log_days_before;
|
||||||
extern FDFSConnectionStat g_connection_stat;
|
extern FDFSConnectionStat g_connection_stat;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue