Skip to content

Commit 8a6810d

Browse files
committed
Add a 'logpath' field to getrpcinfo
1 parent 8f2f17f commit 8a6810d

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
@@ -234,6 +234,10 @@ static UniValue getrpcinfo(const JSONRPCRequest& request)
234234
UniValue result(UniValue::VOBJ);
235235
result.pushKV("active_commands", active_commands);
236236

237+
const std::string path = LogInstance().m_file_path.string();
238+
UniValue log_path(UniValue::VSTR, path);
239+
result.pushKV("logpath", log_path);
240+
237241
return result;
238242
}
239243

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)