From 0a9345b8d482966e68c5f3902814233a463f072b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Fri, 23 May 2014 18:44:40 +0200 Subject: [PATCH] fixed log setup when both --logto and --log2, fixes unbit/uwsgi#635 --- core/uwsgi.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/uwsgi.c b/core/uwsgi.c index 587de25b..30c6561a 100644 --- a/core/uwsgi.c +++ b/core/uwsgi.c @@ -2225,7 +2225,7 @@ void uwsgi_setup(int argc, char *argv[], char *envp[]) { uwsgi_opt_flock(NULL, uwsgi.flock_wait2, NULL); // setup master logging - if (uwsgi.log_master && !uwsgi.daemonize2 && !uwsgi.logto2) + if (uwsgi.log_master && !uwsgi.daemonize2 && uwsgi.logfile) uwsgi_setup_log_master(); // setup offload engines @@ -2507,8 +2507,11 @@ int uwsgi_start(void *v_argv) { if (uwsgi.logto2) { if (!uwsgi.is_a_reload || uwsgi.log_reopen) { + int setup_log = 0; + if (!uwsgi.logfile) setup_log = 1; // logto() will replace uwsgi.logfile and we need to check it later logto(uwsgi.logto2); - uwsgi_setup_log_master(); + if (setup_log) + uwsgi_setup_log_master(); } }