There are currently several instances in roachtest where logging is not standardised. The CRDB logger github.com/cockroachdb/cockroach/pkg/util/log ends up being used in a few places [1].
An effort was made in the past to isolate these logs to a file [2] to avoid cluttering stderr on CI. However, this also had the unintended side effect of writing possibly sensitive information, such as the roachtest program arguments, directly to the log file.
In essence this issue should remove all explicit references to the CRDB log, and instead use the appropriate test logger. Unfortunately it is difficult to completely remove all calls to the CRDB log, since both roachtest and cockroach uses a shared set of testutils. Many of the testutils make CRDB log calls [3]. This leaves us with either enforcing no use of the CRDB log in testutils or no use of testutils in roachtest. Alternatively we could redirect logs from the CRDB log to the correct roachtest test log. This will also alleviate logs from 3rd party libraries that end up redirecting through the CRDB log, which automatically sets up a redirect on init [4].
There are currently several instances in
roachtest
where logging is not standardised. The CRDB loggergithub.com/cockroachdb/cockroach/pkg/util/log
ends up being used in a few places [1].An effort was made in the past to isolate these logs to a file [2] to avoid cluttering stderr on CI. However, this also had the unintended side effect of writing possibly sensitive information, such as the
roachtest
program arguments, directly to the log file.In essence this issue should remove all explicit references to the CRDB log, and instead use the appropriate test logger. Unfortunately it is difficult to completely remove all calls to the CRDB log, since both
roachtest
andcockroach
uses a shared set oftestutils
. Many of thetestutils
make CRDB log calls [3]. This leaves us with either enforcing no use of the CRDB log intestutils
or no use oftestutils
inroachtest
. Alternatively we could redirect logs from the CRDB log to the correctroachtest
test log. This will also alleviate logs from 3rd party libraries that end up redirecting through the CRDB log, which automatically sets up a redirect oninit
[4].[1] https://github.com/cockroachdb/cockroach/blob/master/pkg/cmd/roachtest/tests/restore.go#L1153 [2] https://github.com/cockroachdb/cockroach/pull/110523 [3] https://github.com/cockroachdb/cockroach/blob/master/pkg/testutils/soon.go#L78 [4] https://github.com/cockroachdb/cockroach/blob/master/pkg/util/log/log_bridge.go#L62
Jira issue: CRDB-42538