add storage access log header
parent
3dce9275c3
commit
7042f8d061
3
HISTORY
3
HISTORY
|
|
@ -1,6 +1,7 @@
|
||||||
|
|
||||||
Version 5.11 2017-04-28
|
Version 5.11 2017-05-25
|
||||||
* bug fixed: file_offset has no effect when use trunk file
|
* bug fixed: file_offset has no effect when use trunk file
|
||||||
|
* add storage access log header
|
||||||
|
|
||||||
Version 5.10 2017-03-29
|
Version 5.10 2017-03-29
|
||||||
* use fc_safe_read instead of read, and fc_safe_write instead of write
|
* use fc_safe_read instead of read, and fc_safe_write instead of write
|
||||||
|
|
|
||||||
|
|
@ -1041,6 +1041,14 @@ static int storage_load_paths(IniContext *pItemContext)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void storage_set_access_log_header(struct log_context *pContext)
|
||||||
|
{
|
||||||
|
#define STORAGE_ACCESS_HEADER_STR "client_ip action filename status time_used_ms req_len resp_len"
|
||||||
|
#define STORAGE_ACCESS_HEADER_LEN (sizeof(STORAGE_ACCESS_HEADER_STR) - 1)
|
||||||
|
|
||||||
|
log_header(pContext, STORAGE_ACCESS_HEADER_STR, STORAGE_ACCESS_HEADER_LEN);
|
||||||
|
}
|
||||||
|
|
||||||
int storage_func_init(const char *filename, \
|
int storage_func_init(const char *filename, \
|
||||||
char *bind_addr, const int addr_size)
|
char *bind_addr, const int addr_size)
|
||||||
{
|
{
|
||||||
|
|
@ -1655,6 +1663,7 @@ int storage_func_init(const char *filename, \
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
log_set_header_callback(&g_access_log_context, storage_set_access_log_header);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_rotate_access_log = iniGetBoolValue(NULL, "rotate_access_log",\
|
g_rotate_access_log = iniGetBoolValue(NULL, "rotate_access_log",\
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue