From bc3305efd1e0c512c70219609e1b7a685764d3f1 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 9 Dec 2025 16:35:07 +0000 Subject: [PATCH] log: fix backtrace not going to the --log-file #9014 Before the log re-organisation in: 8d353039a694fb27 log: add log rotation to --log-file rclone would write any backtraces to the --log-file which was very convenient for users. This got accidentally disabled due to a typo which meant backtraces started going to stderr even if --log-file was supplied. This fixes the problem. --- fs/log/log.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/log/log.go b/fs/log/log.go index dd6f5d274..71c6f08a3 100644 --- a/fs/log/log.go +++ b/fs/log/log.go @@ -209,7 +209,7 @@ func InitLogging() { // Log file output if Opt.File != "" { var w io.Writer - if Opt.MaxSize == 0 { + if Opt.MaxSize < 0 { // No log rotation - just open the file as normal // We'll capture tracebacks like this too. f, err := os.OpenFile(Opt.File, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0640)