diff --git a/pkg/util/log/flags.go b/pkg/util/log/flags.go index 26d3e0d15856..9392366fc6f6 100644 --- a/pkg/util/log/flags.go +++ b/pkg/util/log/flags.go @@ -53,10 +53,8 @@ func init() { // Default stderrThreshold to log everything to the process' // external stderr (OrigStderr). defaultConfig.Sinks.Stderr.Filter = severity.INFO - // We only register it for the DEV channels. No other - // channels get a configuration, whereby every channel - // ends up sharing the DEV logger (debugLog). - defaultConfig.Sinks.Stderr.Channels.Channels = []logpb.Channel{channel.DEV} + // Ensure all channels go to stderr. + defaultConfig.Sinks.Stderr.Channels.Channels = logconfig.SelectAllChannels() // We also don't capture internal writes to fd2 by default: // let the writes go to the external stderr. defaultConfig.CaptureFd2.Enable = false diff --git a/pkg/util/log/flags_test.go b/pkg/util/log/flags_test.go index f0ce02a437ef..54a3b7e618c3 100644 --- a/pkg/util/log/flags_test.go +++ b/pkg/util/log/flags_test.go @@ -25,7 +25,7 @@ func TestAppliedStandaloneConfig(t *testing.T) { const expected = `sinks: stderr: - channels: [DEV] + channels: all filter: INFO format: crdb-v2-tty redact: false diff --git a/pkg/util/log/logconfig/config.go b/pkg/util/log/logconfig/config.go index 2305f5545a1e..6fef5711191e 100644 --- a/pkg/util/log/logconfig/config.go +++ b/pkg/util/log/logconfig/config.go @@ -564,7 +564,7 @@ func parseChannelList(s string) ([]logpb.Channel, error) { // Special case: "ALL" selects all channels. if s == "ALL" { - return selectAllChannels(), nil + return SelectAllChannels(), nil } // If channels starts with "all except", we invert the selection. @@ -597,7 +597,7 @@ func selectChannels(invert bool, parts []string) ([]logpb.Channel, error) { if len(parts) != 1 { return nil, errors.New("cannot use ALL if there are other channel names present in the list") } - return selectAllChannels(), nil + return SelectAllChannels(), nil } // Verify the channel name is known. @@ -636,9 +636,9 @@ func selectChannels(invert bool, parts []string) ([]logpb.Channel, error) { return selected, nil } -// selectAllChannels returns a copy of channelValues, +// SelectAllChannels returns a copy of channelValues, // for use in the ALL configuration. -func selectAllChannels() []logpb.Channel { +func SelectAllChannels() []logpb.Channel { // Copy the default in case the code that uses a Config overwrites // its channel list in-place. chans := make([]logpb.Channel, 0, len(channelValues))