37 &ngx_errlog_module_ctx,
68 static const char *debug_levels[] = {
69 "debug_core",
"debug_alloc",
"debug_mutex",
"debug_event",
70 "debug_http",
"debug_mail",
"debug_mysql"
74 #if (NGX_HAVE_VARIADIC_MACROS)
84 const char *fmt, va_list args)
88 #if (NGX_HAVE_VARIADIC_MACROS)
91 u_char *p, *last, *msg;
105 p =
ngx_slprintf(p, last,
" [%V] ", &err_levels[level]);
117 #if (NGX_HAVE_VARIADIC_MACROS)
134 p = log->
handler(log, p, last - p);
143 (void) ngx_write_fd(log->
file->
fd, errstr, p - errstr);
152 msg -= (7 + err_levels[level].
len + 3);
154 (void)
ngx_sprintf(msg,
"nginx: [%V] ", &err_levels[level]);
160 #if !(NGX_HAVE_VARIADIC_MACROS)
164 const char *fmt, ...)
201 "%*s", p - errstr, errstr);
238 if (buf > last - 50) {
249 buf =
ngx_slprintf(buf, last, ((
unsigned) err < 0x80000000)
250 ?
" (%d: " :
" (%Xd: ", err);
271 ngx_log.
file = &ngx_log_file;
291 if (name[1] !=
':') {
293 if (name[0] !=
'/') {
309 name = malloc(plen + nlen + 2);
332 "[alert] could not open error log file: "
336 "could not open error log file: "
362 if (log->
file == NULL) {
382 if (
ngx_strcmp(value[i].data, err_levels[n].data) == 0) {
386 "duplicate log level \"%V\"",
398 if (
ngx_strcmp(value[i].data, debug_levels[n++]) == 0) {
401 "invalid log level \"%V\"",
415 "invalid log level \"%V\"", &value[i]);
434 return "is duplicate";
439 if (
ngx_strcmp(value[1].data,
"stderr") == 0) {