diff --git a/test/feature/conf/router_with_scram_backend.yaml b/test/feature/conf/router_with_scram_backend.yaml index 3ee2ce697..3ecf333b9 100644 --- a/test/feature/conf/router_with_scram_backend.yaml +++ b/test/feature/conf/router_with_scram_backend.yaml @@ -4,6 +4,7 @@ admin_console_port: '7432' grpc_api_port: '7000' router_mode: PROXY log_level: debug +log_file: /var/log/spqr-router.log time_quantiles: - 0.75 world_shard_fallback: true diff --git a/test/feature/spqr_test.go b/test/feature/spqr_test.go index c4bd08c2a..95d8a6341 100644 --- a/test/feature/spqr_test.go +++ b/test/feature/spqr_test.go @@ -81,6 +81,10 @@ var postgresqlLogsToSave = map[string]string{ "/var/log/postgresql/postgresql-13-main.log": "postgresql.log", } +var routerLogsToSave = map[string]string{ + "/var/log/spqr-router.log": "router.log", +} + func (tctx *testContext) saveLogs(scenario string) error { var errs []error for _, service := range tctx.composer.Services() { @@ -88,6 +92,21 @@ func (tctx *testContext) saveLogs(scenario string) error { switch { case strings.HasPrefix(service, spqrShardName): logsToSave = postgresqlLogsToSave + case strings.HasPrefix(service, spqrRouterName): + for file := range routerLogsToSave { + remoteFile, err := tctx.composer.GetFile(service, file) + if err != nil { + errs = append(errs, err) + continue + } + content, err := io.ReadAll(remoteFile) + if err != nil { + errs = append(errs, err) + continue + } + fmt.Println("router logs:") + fmt.Println(string(content)) + } default: continue }