Skip to content

Commit 9339008

Browse files
committed
Merge #15483: rpc: Adding a 'logpath' entry to getrpcinfo
8a6810d Add a 'logpath' field to getrpcinfo (darosior) Pull request description: as discussed in #15438 ACKs for top commit: laanwj: Tested ACK 8a6810d Tree-SHA512: 752c7d90f670677c8144efb338c5c97c2264f85f1e65e031fd5a44f04230b6eafbabd0f634db263eb42c25642ecc1c4b1b602d4735e3fab07ec00b566134ddab
2 parents 085cac6 + 8a6810d commit 9339008

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/rpc/server.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,10 @@ static UniValue getrpcinfo(const JSONRPCRequest& request)
232232
UniValue result(UniValue::VOBJ);
233233
result.pushKV("active_commands", active_commands);
234234

235+
const std::string path = LogInstance().m_file_path.string();
236+
UniValue log_path(UniValue::VSTR, path);
237+
result.pushKV("logpath", log_path);
238+
235239
return result;
236240
}
237241

test/functional/interface_rpc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
55
"""Tests some generic aspects of the RPC interface."""
66

7+
import os
78
from test_framework.authproxy import JSONRPCException
89
from test_framework.test_framework import BitcoinTestFramework
910
from test_framework.util import assert_equal, assert_greater_than_or_equal
@@ -31,6 +32,7 @@ def test_getrpcinfo(self):
3132
command = info['active_commands'][0]
3233
assert_equal(command['method'], 'getrpcinfo')
3334
assert_greater_than_or_equal(command['duration'], 0)
35+
assert_equal(info['logpath'], os.path.join(self.nodes[0].datadir, 'regtest', 'debug.log'))
3436

3537
def test_batch_request(self):
3638
self.log.info("Testing basic JSON-RPC batch request...")

0 commit comments

Comments
 (0)