Skip to content

Commit

Permalink
logging: properly configure the 'log_json_buf_size' global param
Browse files Browse the repository at this point in the history
  • Loading branch information
rvlad-patrascu committed May 16, 2023
1 parent d69a8cc commit 0e7aafd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cfg.y
Original file line number Diff line number Diff line change
Expand Up @@ -962,12 +962,13 @@ assign_stm: LOGLEVEL EQUAL snumber { IFOR();
}
| LOG_JSON_BUF_SIZE EQUAL NUMBER {
IFOR();
xlog_buf_size = $3;
log_json_buf_size = $3;
if (init_log_json_buf(1) < 0) {
yyerror("failed to realloc json log buffer");
YYABORT;
}
}
| LOG_JSON_BUF_SIZE EQUAL error { yyerror("number expected"); }
| LOGFACILITY EQUAL ID { IFOR();
warn("'log_facility' is deprecated, use 'syslog_facility' instead");
if ( (i_tmp=str2facility($3))==-1)
Expand Down
2 changes: 1 addition & 1 deletion dprint.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ char *log_prefix = "";
/* used when resetting the logging level of this process */
static int *default_log_level;

char *log_json_buf = NULL;
static char *log_json_buf = NULL;
int log_json_buf_size = 8192;

static void stderr_dprint(int log_level, int facility, char *module, const char *func,
Expand Down
1 change: 1 addition & 0 deletions dprint.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ extern int log_facility;
extern char* log_name;
extern char ctime_buf[];
extern enum log_format stderr_log_format, syslog_log_format;
extern int log_json_buf_size;

/*
* must be called after init_multi_proc_support()
Expand Down

0 comments on commit 0e7aafd

Please sign in to comment.