Commit 3b7fd702 authored by Hardy Simpson's avatar Hardy Simpson

optmize: call localtime_r per second, speed up!

parent 5382a472
[x] 使用writev来写日志,提高效率,达到一次形成,多次输出的目的
[x] 尝试信号量的方法来打成线程安全的转档互斥问题
[x] zlog.h变长参数宏的问题(参考glib的log解决)
[x] rule的dynamic] file可以从format获取
[x] 修改arraylist的读取长度,循环等
[x] 运行期间指定是否采用线程
[x] buf_append 优化——为了安全,不优化这个
[x] 用某种自动编译器以及文档生成器
[x] 输出到管道,有名管道和文件一样
[x] 打印堆栈。。可能需要语言支持
[x] zlog-input -c category -p priority -f conf
[x] 采用精细的reo en方法来建立用fo en来智能判断需不需要重开文件,操作系统本身已经做得够好,无须做
---
[p] 使用valgrind测试性能
[p] 自己实现部分的strftime,进一步提高效率
[ ] 增加man age, df, 案例
[ ] 和rsyslog对接的问题
[ ] hzlog的可定制话
[ ] 分类匹配的可定制化
[ ] 兼容性问题
zlog.h内,__VA_ARGS__的跨平台
--- 1.0.6 ---
[o] 每秒取一次localtime_r,加速1倍以上
--- 1.0.5 ---
[o] 修复1.0.4的问题,reopen文件时用读写锁保护
--- 1.0.4 ---
[o] 测试多线程的效率
[o] 缓存静态文件的FILE*和fd,优化,加速3倍
--- 1.0.3 ---
[o] 基于日志笔数自动刷新配置
[o] 基于日志笔数自动做sync到硬盘操作
--- 1.0.2 ---
[o] 增加同步写入到硬盘选项,打开后极为费时
--- 1.0.1 ---
[o] 采用配置文件作为锁文件
--- 1.0.0 ---
[o] 改变配置文件的布局,去掉@ &这种符号,改用[global],[format]这样的形式来
[o] 把reload改成原子性的,失败用旧的
[o] 优化spec_gen_msg部分, spec内采用自己写的buf_append对齐来代替buf_sprintf
[o] 引入__func__
[o] 文件的权限设置
[o] 输出函数自定义
--- 0.9 ---
[o] 研究ilog读配置文件, buf
[o] 采用更加面向对象的方法来写
[o] 使用arraylist来代替linklist为内部数据结构
......@@ -41,37 +59,23 @@
[o] ylog, 更简单的接口, 改名为dzlog的一堆接口来解决
[o] zlog-gen-conf
[o] rotate控制个数
--- 0.9 ---
[o] 改变配置文件的布局,去掉@ &这种符号,改用[global],[format]这样的形式来
[o] 把reload改成原子性的,失败用旧的
[o] 优化spec_gen_msg部分, spec内采用自己写的buf_append对齐来代替buf_sprintf
[o] 引入__func__
[o] 文件的权限设置
[o] 输出函数自定义
--- 1.0.0 ---
[o] 采用配置文件作为锁文件
--- 1.0.1 ---
[o] 增加同步写入到硬盘选项,打开后极为费时
--- 1.0.2 ---
[o] 基于日志笔数自动刷新配置
[o] 基于日志笔数自动做sync到硬盘操作
--- 1.0.3 ---
[o] 测试多线程的效率
[o] 缓存静态文件的FILE*和fd,优化
--- 1.0.4 ---
--- 废弃想法 ---
[x] 使用writev来写日志,提高效率,达到一次形成,多次输出的目的
[x] 尝试信号量的方法来打成线程安全的转档互斥问题
[x] zlog.h变长参数宏的问题(参考glib的log解决)
[x] rule的dynamic] file可以从format获取
[x] 修改arraylist的读取长度,循环等
[x] 运行期间指定是否采用线程
[x] buf_append 优化——为了安全,不优化这个
[x] 用某种自动编译器以及文档生成器
[x] 输出到管道,有名管道和文件一样
[x] 打印堆栈。。可能需要语言支持
[x] zlog-input -c category -p priority -f conf
[x] 采用精细的reo en方法来建立用fo en来智能判断需不需要重开文件,操作系统本身已经做得够好,无须做
[p] 使用valgrind测试性能
[ ] 增加man age, df, 案例
[ ] 和rsyslog对接的问题
[ ] hzlog的可定制话
[ ] 分类匹配的可定制化
[ ] 兼容性问题
zlog.h内,__VA_ARGS__的跨平台
==========
编写文章:
==========
打算做一个集中日志系统,设计如下
1.应用程序调用日志库,日志库写本地硬盘日志
......@@ -80,4 +84,3 @@
4.集中日志服务器将日志存入数据库,共实时显示,事后分析用
本机的服务进程和集中日志服务器都打算使用rsyslog,比较专业
日志库打算用log4j,logback之类的,但问题在于第2步
AC_PREREQ(2.59)
AC_INIT([zlog], [1.0.5], [HardySimpson1984@gmail.com])
AC_INIT([zlog], [1.0.6], [HardySimpson1984@gmail.com])
AM_INIT_AUTOMAKE([foreign -Wall -Werror])
AC_CONFIG_SRCDIR([libzlog/zlog.h])
AC_CONFIG_HEADER([config.h])
......
......@@ -2,4 +2,4 @@
# from configure,Makefile.am->Makefile, developer use
CFLAGS="-Wall -Werror -g -O0 -std=c99" ./configure --prefix=/opt/develop/ --enable-test
CFLAGS="-Wall -Werror -g -O2 -std=c99" ./configure --prefix=/opt/develop/ --enable-test
......@@ -1786,7 +1786,8 @@ reference "sub:时间字符"
\begin_inset Text
\begin_layout Plain Layout
环境变量,后面也要跟小括号,内涵环境变量的键。变量的值在zlog_init()的时候就求出来了
环境变量,后面也要跟小括号,内涵环境变量的键。变量的值在zlog_init()的时候就求出来了。所以只含有%E的文件名被认为是静态路径文件,相比动态路径文件写日
志会有一定的性能提升。
\end_layout
\end_inset
......@@ -4814,7 +4815,8 @@ sys 0m6.950s
&default "%d(%F %T) %P [%p:%F:%L] %m%n"
\end_layout
\begin_layout Standard
\end_deeper
\begin_layout Itemize
用户自定义输出详见
\begin_inset CommandInset ref
LatexCommand ref
......@@ -4825,7 +4827,6 @@ reference "sec:用户自定义输出"
\end_layout
\end_deeper
\begin_layout Section
配置文件工具
\end_layout
......
......@@ -1950,7 +1950,9 @@ for more detail.
\begin_layout Plain Layout
Used to output the environment variable.
The key of environment variable should be enclose between parenthesis.Vaule
is fixed at zlog_init()
is fixed at zlog_init().
So the log path contains only %E is through to be static log path.Logging
will be faster than dynamic log path.
\end_layout
\end_inset
......@@ -5092,7 +5094,8 @@ It is optional.
"%d(%F %T) %V [%p:%F:%L] %m%n"
\end_layout
\begin_layout Standard
\end_deeper
\begin_layout Itemize
see
\begin_inset CommandInset ref
LatexCommand ref
......@@ -5103,7 +5106,6 @@ reference "sec:User-defined-Output"
for more details for $.
\end_layout
\end_deeper
\begin_layout Section
Configure File Tools
\end_layout
......
......@@ -163,6 +163,13 @@ zlog_buf_t *zlog_buf_new(size_t buf_size_min, size_t buf_size_max,
}
}
/*******************************************************************************/
void zlog_buf_restart(zlog_buf_t * a_buf)
{
a_buf->end = a_buf->start;
return;
}
/*******************************************************************************/
int zlog_buf_printf(zlog_buf_t * a_buf, const char *format, ...)
{
......
......@@ -40,10 +40,7 @@ zlog_buf_t *zlog_buf_new(size_t buf_size_min, size_t buf_size_max,
void zlog_buf_del(zlog_buf_t * a_buf);
void zlog_buf_profile(zlog_buf_t * a_buf, int flag);
#define zlog_buf_restart(a_buf) do { \
a_buf->end = a_buf->start; \
} while(0);
void zlog_buf_restart(zlog_buf_t * a_buf);
int zlog_buf_printf(zlog_buf_t * a_buf, const char *format, ...);
int zlog_buf_vprintf(zlog_buf_t * a_buf, const char *format, va_list args);
int zlog_buf_append(zlog_buf_t * a_buf, const char *str, size_t str_len);
......
......@@ -38,12 +38,33 @@
#define ZLOG_CONF_DEFAULT_RULE "*.* >stdout"
#define ZLOG_CONF_DEFAULT_BUF_SIZE_MIN 1024
#define ZLOG_CONF_DEFAULT_BUF_SIZE_MAX (2 * 1024 * 1024)
#define ZLOG_CONF_DEFAULT_ROTATE_LOCK_FILE "/tmp/zlog.lock"
#define ZLOG_CONF_DEFAULT_FILE_PERMS 0600
#define ZLOG_CONF_DEFAULT_RELOAD_CONF_PERIOD 0
#define ZLOG_CONF_DEFAULT_FSYNC_PERIOD 0
#define ZLOG_CONF_BACKUP_ROTATE_LOCK_FILE "/tmp/zlog.lock"
/*******************************************************************************/
struct zlog_conf_s {
char file[MAXLEN_PATH + 1];
char mtime[20 + 1];
int strict_init;
size_t buf_size_min;
size_t buf_size_max;
char rotate_lock_file[MAXLEN_CFG_LINE + 1];
zlog_rotater_t *rotater;
zc_arraylist_t *levels;
char default_format_line[MAXLEN_CFG_LINE + 1];
zlog_format_t *default_format;
unsigned int file_perms;
zc_arraylist_t *formats;
zc_arraylist_t *rules;
};
void zlog_conf_profile(zlog_conf_t * a_conf, int flag)
{
int i;
......@@ -62,8 +83,6 @@ void zlog_conf_profile(zlog_conf_t * a_conf, int flag)
zlog_format_profile(a_conf->default_format, flag);
}
zc_profile(flag, "---file perms[0%o]---", a_conf->file_perms);
zc_profile(flag, "---reload conf period[%ld]---", a_conf->reload_conf_period);
zc_profile(flag, "---fsync period[%ld]---", a_conf->fsync_period);
zc_profile(flag, "---rotate lock file[%s]---", a_conf->rotate_lock_file);
if (a_conf->rotater) zlog_rotater_profile(a_conf->rotater, flag);
......@@ -136,15 +155,9 @@ zlog_conf_t *zlog_conf_new(char *conf_file)
a_conf->strict_init = 1;
a_conf->buf_size_min = ZLOG_CONF_DEFAULT_BUF_SIZE_MIN;
a_conf->buf_size_max = ZLOG_CONF_DEFAULT_BUF_SIZE_MAX;
if (has_conf_file) {
strcpy(a_conf->rotate_lock_file, a_conf->file);
} else {
strcpy(a_conf->rotate_lock_file, ZLOG_CONF_BACKUP_ROTATE_LOCK_FILE);
}
strcpy(a_conf->rotate_lock_file, ZLOG_CONF_DEFAULT_ROTATE_LOCK_FILE);
strcpy(a_conf->default_format_line, ZLOG_CONF_DEFAULT_FORMAT);
a_conf->file_perms = ZLOG_CONF_DEFAULT_FILE_PERMS;
a_conf->reload_conf_period = ZLOG_CONF_DEFAULT_RELOAD_CONF_PERIOD;
a_conf->fsync_period = ZLOG_CONF_DEFAULT_FSYNC_PERIOD;
/* set default configuration end */
a_conf->levels = zlog_level_list_new();
......@@ -152,7 +165,8 @@ zlog_conf_t *zlog_conf_new(char *conf_file)
zc_error("zlog_level_list_new fail");
rc = -1;
goto zlog_conf_new_exit;
}
}
a_conf->formats = zc_arraylist_new((zc_arraylist_del_fn) zlog_format_del);
if (!a_conf->formats) {
zc_error("zc_arraylist_new fail");
......@@ -214,8 +228,7 @@ static int zlog_conf_build_without_file(zlog_conf_t * a_conf)
a_conf->levels,
a_conf->default_format,
a_conf->formats,
a_conf->file_perms,
a_conf->fsync_period);
a_conf->file_perms);
if (!default_rule) {
zc_error("zlog_rule_new fail");
return -1;
......@@ -434,11 +447,6 @@ static int zlog_conf_parse_line(zlog_conf_t * a_conf, char *line, int *section)
} else if (STRCMP(word_1, ==, "default") && STRCMP(word_2, ==, "format")) {
/* so the input now is [format = "xxyy"], fit format's style */
strcpy(a_conf->default_format_line, line + nread);
} else if (STRCMP(word_1, ==, "reload") &&
STRCMP(word_2, ==, "conf") && STRCMP(word_3, ==, "period")) {
a_conf->reload_conf_period = zc_parse_byte_size(value);
} else if (STRCMP(word_1, ==, "fsync") && STRCMP(word_2, ==, "period")) {
a_conf->fsync_period = zc_parse_byte_size(value);
} else {
zc_error("name[%s] is not any one of global options", name);
if (a_conf->strict_init) return -1;
......@@ -471,9 +479,7 @@ static int zlog_conf_parse_line(zlog_conf_t * a_conf, char *line, int *section)
a_conf->levels,
a_conf->default_format,
a_conf->formats,
a_conf->file_perms,
a_conf->fsync_period);
a_conf->file_perms);
if (!a_rule) {
zc_error("zlog_rule_new fail [%s]", line);
if (a_conf->strict_init) return -1;
......@@ -495,3 +501,25 @@ static int zlog_conf_parse_line(zlog_conf_t * a_conf, char *line, int *section)
return 0;
}
/*******************************************************************************/
zc_arraylist_t *zlog_conf_get_rules(zlog_conf_t *a_conf)
{
zc_assert(a_conf, NULL);
return a_conf->rules;
}
void zlog_conf_get_buf_size(zlog_conf_t *a_conf,
size_t * buf_size_min, size_t * buf_size_max)
{
zc_assert(a_conf,);
zc_assert(buf_size_min,);
zc_assert(buf_size_max,);
*buf_size_min = a_conf->buf_size_min;
*buf_size_max = a_conf->buf_size_max;
}
char *zlog_conf_get_file(zlog_conf_t *a_conf)
{
zc_assert(a_conf, NULL);
return a_conf->file;
}
......@@ -22,33 +22,16 @@
#include "zc_defs.h"
#include "format.h"
#include "rotater.h"
typedef struct zlog_conf_s {
char file[MAXLEN_PATH + 1];
char mtime[20 + 1];
int strict_init;
size_t buf_size_min;
size_t buf_size_max;
char rotate_lock_file[MAXLEN_CFG_LINE + 1];
zlog_rotater_t *rotater;
char default_format_line[MAXLEN_CFG_LINE + 1];
zlog_format_t *default_format;
unsigned int file_perms;
size_t fsync_period;
size_t reload_conf_period;
zc_arraylist_t *levels;
zc_arraylist_t *formats;
zc_arraylist_t *rules;
} zlog_conf_t;
typedef struct zlog_conf_s zlog_conf_t;
zlog_conf_t *zlog_conf_new(char *conf_file);
void zlog_conf_del(zlog_conf_t * a_conf);
void zlog_conf_profile(zlog_conf_t * a_conf, int flag);
zc_arraylist_t *zlog_conf_get_rules(zlog_conf_t *a_conf);
void zlog_conf_get_buf_size(zlog_conf_t *a_conf,
size_t * buf_size_min, size_t * buf_size_max);
char *zlog_conf_get_file(zlog_conf_t *a_conf);
#endif
......@@ -450,11 +450,13 @@ int zlog_rotater_rotate(zlog_rotater_t *a_rotater,
rc = stat(file_path, &info);
if (rc) {
zc_warn("stat [%s] fail, errno[%d], maybe in rotating", file_path, errno);
return 0;
zc_error("stat [%s] fail, errno[%d]", file_path, errno);
return -1;
} else {
/* file not so big, return */
if (info.st_size + msg_len < file_max_size) return 0;
if (info.st_size + msg_len < file_max_size) {
/* file not so big, return */
return 0;
}
}
rd = zlog_rotater_trylock(a_rotater);
......@@ -485,7 +487,6 @@ int zlog_rotater_rotate(zlog_rotater_t *a_rotater,
rc = -1;
goto zlog_rotater_rotate_exit;
} else if (rc == 0) {
rc = 1;
zc_debug("zlog_rotater_file_ls_mv success");
}
......
......@@ -26,13 +26,6 @@ typedef struct zlog_rotater_s zlog_rotater_t;
zlog_rotater_t *zlog_rotater_new(char *lock_file);
void zlog_rotater_del(zlog_rotater_t *a_rot);
/*
* return
* -1 fail
* 0 no rotate
* 1 rotate and success
*/
int zlog_rotater_rotate(zlog_rotater_t *a_rot,
char *file_path, long file_max_size, int file_max_count,
size_t msg_len);
......
This diff is collapsed.
......@@ -39,8 +39,7 @@ zlog_rule_t *zlog_rule_new(char *line,
zc_arraylist_t * levels,
zlog_format_t * default_format,
zc_arraylist_t * formats,
unsigned int file_perms,
size_t fsync_period);
unsigned int file_perms);
void zlog_rule_del(zlog_rule_t * a_rule);
void zlog_rule_profile(zlog_rule_t * a_rule, int flag);
......
......@@ -25,7 +25,6 @@
#include <time.h>
#include <sys/types.h>
#include <unistd.h>
#include <signal.h>
#include "zc_profile.h"
#include "zc_xplatform.h"
......@@ -50,9 +49,10 @@ int zc_profile_inner(int flag, const char *file, const long line, const char *fm
static char *debug_log = NULL;
static char *error_log = NULL;
static volatile sig_atomic_t init_flag = 0;
static volatile int init_flag = 0;
if (!init_flag) {
/* maybe not thread-safe here, but that's the only light way */
init_flag = 1;
debug_log = getenv("ZLOG_PROFILE_DEBUG");
error_log = getenv("ZLOG_PROFILE_ERROR");
......@@ -82,9 +82,6 @@ int zc_profile_inner(int flag, const char *file, const long line, const char *fm
break;
}
/* writing file twice(time & msg) is not atomic
* may cause cross
* but avoid log size limit */
va_start(args, fmt);
vfprintf(fp, fmt, args);
va_end(args);
......
......@@ -33,7 +33,6 @@ size_t zc_parse_byte_size(char *astring)
char *q;
size_t sz;
long res;
int c, m;
zc_assert(astring, 0);
......@@ -55,32 +54,49 @@ size_t zc_parse_byte_size(char *astring)
return 0;
if (astring[sz - 1] == 'B' || astring[sz - 1] == 'b') {
c = astring[sz - 2];
m = 1024;
switch (astring[sz - 2]) {
case 'K':
case 'k':
res = res * 1024;
break;
case 'M':
case 'm':
res *= 1024 * 1024;
break;
case 'G':
case 'g':
res *= 1024 * 1024 * 1024;
break;
default:
if (!isdigit(astring[sz - 1])) {
zc_error("Wrong suffix parsing "
"size in bytes for string [%s], ignoring suffix",
astring);
}
break;
}
} else {
c = astring[sz - 1];
m = 1000;
}
switch (c) {
case 'K':
case 'k':
res *= m;
break;
case 'M':
case 'm':
res *= m * m;
break;
case 'G':
case 'g':
res *= m * m * m;
break;
default:
if (!isdigit(c)) {
zc_error("Wrong suffix parsing " "size in bytes for string [%s], ignoring suffix",
astring);
switch (astring[sz - 1]) {
case 'K':
case 'k':
res = res * 1024;
break;
case 'M':
case 'm':
res *= 1024 * 1024;
break;
case 'G':
case 'g':
res *= 1024 * 1024 * 1024;
break;
default:
if (!isdigit(astring[sz - 1])) {
zc_error("Wrong suffix parsing "
"size in bytes for string [%s], ignoring suffix",
astring);
}
break;
}
break;
}
return (res);
......
......@@ -22,7 +22,6 @@
#include <stdarg.h>
#include <string.h>
#include <pthread.h>
#include <signal.h>
#include "conf.h"
#include "category_table.h"
......@@ -39,7 +38,6 @@ static zc_hashtable_t *zlog_env_threads;
static zc_hashtable_t *zlog_env_categories;
static zc_hashtable_t *zlog_env_records;
static zlog_category_t *zlog_default_category;
static volatile sig_atomic_t zlog_env_reload_conf_count;
static int zlog_env_init_flag = 0;
/*******************************************************************************/
/* inner no need thread-safe */
......@@ -60,6 +58,8 @@ static int zlog_init_inner(char *confpath)
{
int rc = 0;
zlog_thread_t *a_thread;
size_t buf_size_min;
size_t buf_size_max;
zlog_env_conf = zlog_conf_new(confpath);
if (!zlog_env_conf) {
......@@ -89,8 +89,10 @@ static int zlog_init_inner(char *confpath)
goto zlog_init_inner_exit;
}
zlog_conf_get_buf_size(zlog_env_conf, &buf_size_min, &buf_size_max);
a_thread = zlog_thread_table_new_thread(zlog_env_threads,
zlog_env_conf->buf_size_min, zlog_env_conf->buf_size_max);
buf_size_min, buf_size_max);
if (!a_thread) {
zc_error("zlog_thread_table_new_thread fail");
rc = -1;
......@@ -171,7 +173,7 @@ int dzlog_init(char *confpath, char *cname)
zlog_default_category = zlog_category_table_fetch_category(
zlog_env_categories,
cname,
zlog_env_conf->rules);
zlog_conf_get_rules(zlog_env_conf));
if (!zlog_default_category) {
zc_error("zlog_category_table_fetch_category[%s] fail",
cname);
......@@ -200,6 +202,10 @@ int zlog_reload(char *confpath)
int i = 0;
zlog_conf_t *new_conf = NULL;
zlog_rule_t *a_rule;
size_t new_buf_size_min;
size_t new_buf_size_max;
size_t old_buf_size_min;
size_t old_buf_size_max;
int do_thread_flag;
zc_debug("------zlog_reload start------");
......@@ -215,23 +221,11 @@ int zlog_reload(char *confpath)
goto zlog_reload_exit_2;
}
/* use last conf file */
if (confpath == NULL) confpath = zlog_env_conf->file;
/* reach reload period */
if (confpath == (char*)-1) {
/* test again, avoid other threads already reloaded */
if (zlog_env_reload_conf_count > zlog_env_conf->reload_conf_period) {
confpath = zlog_env_conf->file;
} else {
/* do nothing, already done */
goto zlog_reload_exit_2;
}
if (confpath == NULL) {
/* use last conf file */
confpath = zlog_conf_get_file(zlog_env_conf);
}
/* reset counter, whether automaticlly or mannually */
zlog_env_reload_conf_count = 0;
new_conf = zlog_conf_new(confpath);
if (!new_conf) {
zc_error("zlog_conf_new fail");
......@@ -239,22 +233,24 @@ int zlog_reload(char *confpath)
goto zlog_reload_exit;
}
zc_arraylist_foreach(new_conf->rules, i, a_rule) {
zc_arraylist_foreach(zlog_conf_get_rules(new_conf), i, a_rule) {
zlog_rule_set_record(a_rule, zlog_env_records);
}
rc = zlog_category_table_update_rules(zlog_env_categories, new_conf->rules);
rc = zlog_category_table_update_rules(zlog_env_categories, zlog_conf_get_rules(new_conf));
if (rc) {
zc_error("zlog_category_table_update fail");
rc = -1;
goto zlog_reload_exit;
}
if ((new_conf->buf_size_min != zlog_env_conf->buf_size_min) ||
(new_conf->buf_size_max != zlog_env_conf->buf_size_max) ) {
zlog_conf_get_buf_size(zlog_env_conf, &old_buf_size_min, &old_buf_size_max);
zlog_conf_get_buf_size(new_conf, &new_buf_size_min, &new_buf_size_max);
if ((new_buf_size_min != old_buf_size_min) || (new_buf_size_max != old_buf_size_max) ) {
do_thread_flag = 1;
rc = zlog_thread_table_update_msg_buf(zlog_env_threads,
new_conf->buf_size_min, new_conf->buf_size_max);
new_buf_size_min, new_buf_size_max);
if (rc) {
zc_error("zlog_category_table_update fail");
rc = -1;
......@@ -341,7 +337,7 @@ zlog_category_t *zlog_get_category(char *cname)
a_category = zlog_category_table_fetch_category(
zlog_env_categories,
cname,
zlog_env_conf->rules);
zlog_conf_get_rules(zlog_env_conf));
if (!a_category) {
zc_error("zlog_category_table_fetch_category[%s] fail", cname);
goto zlog_get_category_exit;
......@@ -380,7 +376,7 @@ int dzlog_set_category(char *cname)
zlog_default_category = zlog_category_table_fetch_category(
zlog_env_categories,
cname,
zlog_env_conf->rules);
zlog_conf_get_rules(zlog_env_conf));
if (!zlog_default_category) {
zc_error("zlog_category_table_fetch_category[%s] fail", cname);
rc = -1;
......@@ -438,10 +434,13 @@ int zlog_put_mdc(char *key, char *value)
*/
a_thread = zlog_thread_table_get_thread(zlog_env_threads, pthread_self());
if (!a_thread) {
size_t buf_size_min;
size_t buf_size_max;