From e78a80495ba69ff3aaac7a29326b8b1a9bb7b89b Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 5 Aug 2019 14:40:29 +0930 Subject: [PATCH] log: make --log-file an early arg (since we move to dir early now). Otherwise we bleed plugin log messages to stderr, as they're initted before log-file. Signed-off-by: Rusty Russell --- lightningd/log.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lightningd/log.c b/lightningd/log.c index cf59caa98..388426623 100644 --- a/lightningd/log.c +++ b/lightningd/log.c @@ -549,9 +549,8 @@ void opt_register_logging(struct lightningd *ld) opt_register_early_arg("--log-prefix", arg_log_prefix, show_log_prefix, ld->log, "log prefix"); - /* We want this opened later, once we have moved to lightning dir */ - opt_register_arg("--log-file=", arg_log_to_file, NULL, ld, - "log to file instead of stdout"); + opt_register_early_arg("--log-file=", arg_log_to_file, NULL, ld, + "log to file instead of stdout"); } void log_backtrace_print(const char *fmt, ...)