aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2010-11-29 15:01:06 +0000
committerIgor Sysoev <igor@sysoev.ru>2010-11-29 15:01:06 +0000
commitc19b8489760e0c62314407c702916f500106f116 (patch)
tree0c486eb1e7fb97b3ccea5f2cce54afc73ec88aec
parenta979d9fb304e41e0be027d757dccaaba2b114a18 (diff)
downloadnginx-c19b8489760e0c62314407c702916f500106f116.tar.gz
nginx-c19b8489760e0c62314407c702916f500106f116.zip
add "nginx: " prefix when logging to the stderr
-rw-r--r--src/core/ngx_log.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/core/ngx_log.c b/src/core/ngx_log.c
index 156d3567f..ec0430355 100644
--- a/src/core/ngx_log.c
+++ b/src/core/ngx_log.c
@@ -148,9 +148,9 @@ ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
return;
}
- msg -= (err_levels[level].len + 4);
+ msg -= (7 + err_levels[level].len + 4);
- (void) ngx_sprintf(msg, "[%V]: ", &err_levels[level]);
+ (void) ngx_sprintf(msg, "nginx: [%V]: ", &err_levels[level]);
(void) ngx_write_console(ngx_stderr, msg, p - msg);
}
@@ -209,9 +209,12 @@ ngx_log_stderr(ngx_err_t err, const char *fmt, ...)
u_char errstr[NGX_MAX_ERROR_STR];
last = errstr + NGX_MAX_ERROR_STR;
+ p = errstr + 7;
+
+ ngx_memcpy(errstr, "nginx: ", 7);
va_start(args, fmt);
- p = ngx_vslprintf(errstr, last, fmt, args);
+ p = ngx_vslprintf(p, last, fmt, args);
va_end(args);
if (err) {