From bbc97127067ac2e6b9e1ae7eec99794460258283 Mon Sep 17 00:00:00 2001 From: hairetikos <19870044+hairetikos@users.noreply.github.com> Date: Tue, 25 Nov 2025 21:44:20 +0000 Subject: [PATCH 1/2] disable debug.log by default This insecure default was inherited from zcash. the debug log may contain sensitive transaction metadata. it should only be used for debugging, not for production, therefore debug logs now are not created unless explicitly enabled. --- src/util.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.cpp b/src/util.cpp index 26486d25c92..2ea5d583cc9 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -106,7 +106,7 @@ map mapArgs; map > mapMultiArgs; bool fDebug = false; bool fPrintToConsole = false; -bool fPrintToDebugLog = true; +bool fPrintToDebugLog = false; bool fDaemon = false; bool fServer = false; string strMiscWarning; From 2c7409463e5818ac07558b7fa0a0dbcc709ad2ee Mon Sep 17 00:00:00 2001 From: hairetikos <19870044+hairetikos@users.noreply.github.com> Date: Tue, 25 Nov 2025 21:49:40 +0000 Subject: [PATCH 2/2] Add debug.log option since it is disabled now since we now disable debug.log by default, add option to enable debug.log --- src/init.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/init.cpp b/src/init.cpp index f849b868ec4..6d9cd1d8baf 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -473,6 +473,7 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += HelpMessageOpt("-experimentalfeatures", _("Enable use of experimental features")); strUsage += HelpMessageOpt("-help-debug", _("Show all debugging options (usage: --help -help-debug)")); strUsage += HelpMessageOpt("-logips", strprintf(_("Include IP addresses in debug output (default: %u)"), 0)); + strUsage += HelpMessageOpt("-debuglogfile", _("Write debug output to debug.log file (default: 0, disabled for privacy)")); strUsage += HelpMessageOpt("-logtimestamps", strprintf(_("Prepend debug output with timestamp (default: %u)"), 1)); if (showDebug) { @@ -14486,6 +14487,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) // Set this early so that parameter interactions go to console fPrintToConsole = GetBoolArg("-printtoconsole", false); fLogTimestamps = GetBoolArg("-logtimestamps", true); + fPrintToDebugLog = GetBoolArg("-debuglogfile", false); fLogIPs = GetBoolArg("-logips", false); LogPrintf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");