summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_log.c
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2021-03-24 08:05:07 +0300
committerValentin Bartenev <vbart@nginx.com>2021-03-24 08:05:07 +0300
commitb04832da844d1c9e4ce7f7ff387059fbd07f78d3 (patch)
treefab90c9b49e71aafce61d4616b0a542f97e03d83 /src/nxt_log.c
parent175ef1c1dbe5a8fb65b1fbb4adb8a56a16b08569 (diff)
downloadunit-b04832da844d1c9e4ce7f7ff387059fbd07f78d3.tar.gz
unit-b04832da844d1c9e4ce7f7ff387059fbd07f78d3.tar.bz2
Disabled logging alerts to syslog.
It feels to be causing more harm than good, because syslog() can be blocking, which is even more critical under resource exhaustion conditions when some alerts are expected.
Diffstat (limited to '')
-rw-r--r--src/nxt_log.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/nxt_log.c b/src/nxt_log.c
index 1c666961..58756816 100644
--- a/src/nxt_log.c
+++ b/src/nxt_log.c
@@ -66,7 +66,10 @@ nxt_log_set_ctx(nxt_log_t *log, nxt_log_ctx_handler_t handler, void *ctx)
void nxt_cdecl
nxt_log_handler(nxt_uint_t level, nxt_log_t *log, const char *fmt, ...)
{
- u_char *p, *syslogmsg, *end;
+ u_char *p, *end;
+#if 0
+ u_char *syslogmsg;
+#endif
va_list args;
u_char msg[NXT_MAX_ERROR_STR];
@@ -79,7 +82,9 @@ nxt_log_handler(nxt_uint_t level, nxt_log_t *log, const char *fmt, ...)
*p++ = ' ';
}
+#if 0
syslogmsg = p;
+#endif
p = nxt_sprintf(p, end, (log->ident != 0) ? "[%V] *%D " : "[%V] ",
&nxt_log_levels[level], log->ident);
@@ -100,6 +105,7 @@ nxt_log_handler(nxt_uint_t level, nxt_log_t *log, const char *fmt, ...)
(void) nxt_write_console(nxt_stderr, msg, p - msg);
+#if 0
if (level == NXT_LOG_ALERT) {
*(p - nxt_length("\n")) = '\0';
@@ -109,4 +115,5 @@ nxt_log_handler(nxt_uint_t level, nxt_log_t *log, const char *fmt, ...)
*/
nxt_write_syslog(LOG_ALERT, syslogmsg);
}
+#endif
}