diff --git a/src/test/subscription/t/001_rep_changes.pl b/src/test/subscription/t/001_rep_changes.pl
index b2fdb289db..abe5efd31d 100644
--- a/src/test/subscription/t/001_rep_changes.pl
+++ b/src/test/subscription/t/001_rep_changes.pl
@@ -309,6 +309,8 @@ is( $result, qq(1|bar
 $node_subscriber->append_conf('postgresql.conf', "log_min_messages = debug1");
 $node_subscriber->reload;
 
+my $log_location = -s $node_subscriber->logfile;
+
 $node_subscriber->safe_psql('postgres', "DELETE FROM tab_full_pk");
 
 $node_publisher->safe_psql('postgres',
@@ -317,7 +319,7 @@ $node_publisher->safe_psql('postgres', "DELETE FROM tab_full_pk WHERE a = 2");
 
 $node_publisher->wait_for_catchup('tap_sub');
 
-my $logfile = slurp_file($node_subscriber->logfile());
+my $logfile = slurp_file($node_subscriber->logfile, $log_location);
 ok( $logfile =~
 	  qr/logical replication did not find row to be updated in replication target relation "tab_full_pk"/,
 	'update target row is missing');
diff --git a/src/test/subscription/t/013_partition.pl b/src/test/subscription/t/013_partition.pl
index d0b5a55d18..f309153cf9 100644
--- a/src/test/subscription/t/013_partition.pl
+++ b/src/test/subscription/t/013_partition.pl
@@ -354,6 +354,8 @@ $node_subscriber1->append_conf('postgresql.conf',
 	"log_min_messages = debug1");
 $node_subscriber1->reload;
 
+my $log_location = -s $node_subscriber1->logfile;
+
 $node_publisher->safe_psql('postgres',
 	"INSERT INTO tab1 VALUES (1, 'foo'), (4, 'bar'), (10, 'baz')");
 
@@ -369,7 +371,7 @@ $node_publisher->safe_psql('postgres', "DELETE FROM tab1");
 $node_publisher->wait_for_catchup('sub1');
 $node_publisher->wait_for_catchup('sub2');
 
-my $logfile = slurp_file($node_subscriber1->logfile());
+my $logfile = slurp_file($node_subscriber1->logfile(), $log_location);
 ok( $logfile =~
 	  qr/logical replication did not find row to be updated in replication target relation's partition "tab1_2_2"/,
 	'update target row is missing in tab1_2_2');
