0diff --git a/src/rpc/client.cpp b/src/rpc/client.cpp
1index 0693b60557..25c313c552 100644
2--- a/src/rpc/client.cpp
3+++ b/src/rpc/client.cpp
4@@ -325,7 +325,7 @@ static const CRPCConvertParam vRPCConvertParams[] =
5 { "psbtbumpfee", 1, "replaceable"},
6 { "psbtbumpfee", 1, "outputs"},
7 { "psbtbumpfee", 1, "original_change_index"},
8- { "logging", 0, "include" },
9+ { "logging", 0, "debug" },
10 { "logging", 1, "exclude" },
11 { "logging", 2, "trace" },
12 { "disconnectnode", 1, "nodeid" },
13diff --git a/src/rpc/node.cpp b/src/rpc/node.cpp
14index abca5e69bd..06714bde37 100644
15--- a/src/rpc/node.cpp
16+++ b/src/rpc/node.cpp
17@@ -225,20 +225,22 @@ static void EnableOrDisableLogCategories(UniValue cats, BCLog::Level new_level)
18
19 static RPCHelpMan logging()
20 {
21+ const bool use_deprecated = IsDeprecatedRPCEnabled("logging");
22+ const std::string debug_category_name{use_deprecated ? "include" : "debug"};
23 return RPCHelpMan{"logging",
24 "Gets and sets the logging configuration.\n"
25 "When called without an argument, returns the the status of the supported logging categories.\n"
26 "When called with arguments, adds or removes categories from debug or trace logging and return the lists above.\n"
27- "The arguments are evaluated in order \"include\", \"trace\", \"exclude\".\n"
28- "If an item is both included/traced and excluded, it will thus end up being excluded.\n"
29+ "The arguments are evaluated in order \"" + debug_category_name + "\", \"trace\", \"exclude\".\n"
30+ "If an item is debug and/or trace but also excluded, it will thus end up being excluded.\n"
31 "The valid logging categories are: " + LogInstance().LogCategoriesString() + "\n"
32 "In addition, the following are available as category names with special meanings:\n"
33 " - \"all\", \"1\" : represent all logging categories.\n"
34 ,
35 {
36- {"include", RPCArg::Type::ARR, RPCArg::Optional::OMITTED, "The categories to add to debug logging",
37+ {debug_category_name, RPCArg::Type::ARR, RPCArg::Optional::OMITTED, "The categories to add to debug logging",
38 {
39- {"include_category", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "the valid logging category"},
40+ {"debug_category", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "the debug logging category"},
41 }},
42 {"exclude", RPCArg::Type::ARR, RPCArg::Optional::OMITTED, "The categories to remove from debug logging",
43 {
44@@ -249,14 +251,14 @@ static RPCHelpMan logging()
45 {"trace_category", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "the valid logging category"},
46 }},
47 },
48- {
49- RPCResult{"If -deprecatedrpc=logging is set",
50+ { use_deprecated ?
51+ RPCResult{
52 RPCResult::Type::OBJ_DYN, "", "keys are the logging categories, and values indicates its status",
53 {
54 {RPCResult::Type::BOOL, "category", "if being debug logged or not. false:inactive, true:active"},
55 }
56- },
57- RPCResult{"Otherwise",
58+ } :
59+ RPCResult{
60 RPCResult::Type::OBJ, "", "",
61 {{
62 {RPCResult::Type::ARR, "excluded", "excluded categories", {{RPCResult::Type::STR, "", ""}}},
63@@ -289,7 +291,6 @@ static RPCHelpMan logging()
64 UpdateHTTPServerLogging(LogInstance().WillLogCategory(BCLog::LIBEVENT));
65 }
66
67- bool use_deprecated = IsDeprecatedRPCEnabled("logging");
68 UniValue result(UniValue::VOBJ);
69 if (use_deprecated) {
70 for (const auto& info : LogInstance().LogCategoriesInfo()) {
71diff --git a/test/functional/rpc_misc.py b/test/functional/rpc_misc.py
72index fa1de774b7..4dfe13ec99 100755
73--- a/test/functional/rpc_misc.py
74+++ b/test/functional/rpc_misc.py
75@@ -80,10 +80,12 @@ class RpcMiscTest(BitcoinTestFramework):
76 assert('qt' in node.logging()['trace'])
77 node.logging(exclude=['qt'])
78 assert('qt' in node.logging()['excluded'])
79- node.logging(include=['qt'])
80+ node.logging(debug=['qt'])
81 assert('qt' in node.logging()['debug'])
82 node.logging(trace=['qt'])
83 assert('qt' in node.logging()['trace'])
84+ # "include" is now deprecated in favour of "debug"
85+ assert_raises_rpc_error(-8, "Unknown named parameter include", node.logging, include="net")
86
87 # Test logging RPC returns the logging categories in alphabetical order.
88 logging = node.logging()
89@@ -125,6 +127,10 @@ class RpcMiscTest(BitcoinTestFramework):
90 # Specifying an unknown index name returns an empty result
91 assert_equal(node.getindexinfo("foo"), {})
92
93+ # Test that deprecatedrpc="logging" maintains behaviour
94+ self.restart_node(0, ["-deprecatedrpc=logging"])
95+ node.logging(include=["net"])
96+ assert_raises_rpc_error(-8, "Unknown named parameter debug", node.logging, debug="net")
97
98 if __name__ == '__main__':
99 RpcMiscTest(__file__).main()