Skip to content

Commit fe1a87c

Browse files
committed
Added dynamic log-file-path fetching
1 parent 2fc6516 commit fe1a87c

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

client/src/cbltest/api/syncgateway.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,6 +1114,16 @@ async def _replaced_revid(
11141114
assert revid == response_dict["_cv"] or revid == response_dict["_rev"]
11151115
return cast(dict, response)["_rev"]
11161116

1117+
1118+
async def get_server_config(self) -> dict[str, Any]:
1119+
"""
1120+
Gets the server-level configuration from the admin API.
1121+
1122+
Returns:
1123+
Dictionary containing the server configuration including logging settings
1124+
"""
1125+
return await self._send_request("GET", "/_config")
1126+
11171127
async def delete_document(
11181128
self,
11191129
doc_id: str,

tests/QE/test_log_redaction.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,11 @@ async def test_log_redaction_partial(
7777
)
7878

7979
self.mark_test_step("Fetch and scan SG logs for redaction violations")
80-
remote_log_path = "/home/ec2-user/log/sg_debug.log"
80+
server_config = await sg.get_server_config()
81+
log_dir = server_config.get("logging", {}).get(
82+
"log_file_path", "/home/ec2-user/log"
83+
)
84+
remote_log_path = f"{log_dir}/sg_debug.log"
8185
try:
8286
log_contents = sg.fetch_log_file(remote_log_path, ssh_key_path)
8387
except Exception as e:

0 commit comments

Comments
 (0)