Skip to content

Commit

Permalink
Log version string for more tools at startup (#7087)
Browse files Browse the repository at this point in the history
This is a followup to #7086
  • Loading branch information
pgporada authored Sep 19, 2023
1 parent cad7266 commit 4bd90ea
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmd/admin-revoker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ type revoker struct {

func newRevoker(c Config) *revoker {
logger := cmd.NewLogger(c.Syslog)
logger.Info(cmd.VersionString())

// TODO(#6840) Rework admin-revoker to export prometheus metrics.
tlsConfig, err := c.Revoker.TLS.Load(metrics.NoopRegisterer)
Expand Down
1 change: 1 addition & 0 deletions cmd/bad-key-revoker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ func main() {

scope, logger, oTelShutdown := cmd.StatsAndLogging(config.Syslog, config.OpenTelemetry, config.BadKeyRevoker.DebugAddr)
defer oTelShutdown(context.Background())
logger.Info(cmd.VersionString())
clk := cmd.Clock()

scope.MustRegister(keysProcessed)
Expand Down
1 change: 1 addition & 0 deletions cmd/caa-log-checker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ func main() {
StdoutLevel: *logStdoutLevel,
SyslogLevel: *logSyslogLevel,
})
logger.Info(cmd.VersionString())

if *timeTolerance < 0 {
cmd.Fail("value of -time-tolerance must be non-negative")
Expand Down
1 change: 1 addition & 0 deletions cmd/contact-auditor/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ func main() {
flag.Parse()

logger := cmd.NewLogger(cmd.SyslogConfig{StdoutLevel: 7})
logger.Info(cmd.VersionString())

if *configFile == "" {
flag.Usage()
Expand Down
1 change: 1 addition & 0 deletions cmd/crl-checker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func main() {
flag.Parse()

logger := cmd.NewLogger(cmd.SyslogConfig{StdoutLevel: 6, SyslogLevel: -1})
logger.Info(cmd.VersionString())

urlFileContents, err := os.ReadFile(*urlFile)
cmd.FailOnError(err, "Reading CRL URLs file")
Expand Down
1 change: 1 addition & 0 deletions cmd/id-exporter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ func main() {
}

log := cmd.NewLogger(cmd.SyslogConfig{StdoutLevel: 7})
log.Info(cmd.VersionString())

// Load configuration file.
configData, err := os.ReadFile(*configFile)
Expand Down
1 change: 1 addition & 0 deletions cmd/log-validator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ func main() {

stats, logger, oTelShutdown := cmd.StatsAndLogging(config.Syslog, config.OpenTelemetry, config.DebugAddr)
defer oTelShutdown(context.Background())
logger.Info(cmd.VersionString())
lineCounter := prometheus.NewCounterVec(prometheus.CounterOpts{
Name: "log_lines",
Help: "A counter of log lines processed, with status",
Expand Down
1 change: 1 addition & 0 deletions cmd/notify-mailer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@ func main() {
cmd.FailOnError(err, "Couldn't unmarshal JSON config file")

log := cmd.NewLogger(cfg.Syslog)
log.Info(cmd.VersionString())

dbMap, err := sa.InitWrappedDb(cfg.NotifyMailer.DB, nil, log)
cmd.FailOnError(err, "While initializing dbMap")
Expand Down
1 change: 1 addition & 0 deletions cmd/reversed-hostname-checker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func main() {

scanner := bufio.NewScanner(input)
logger := cmd.NewLogger(cmd.SyslogConfig{StdoutLevel: 7})
logger.Info(cmd.VersionString())
pa, err := policy.New(nil, logger)
if err != nil {
log.Fatal(err)
Expand Down
1 change: 1 addition & 0 deletions cmd/rocsp-tool/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ func main2() error {

_, logger, oTelShutdown := cmd.StatsAndLogging(conf.Syslog, conf.OpenTelemetry, conf.ROCSPTool.DebugAddr)
defer oTelShutdown(context.Background())
logger.Info(cmd.VersionString())

clk := cmd.Clock()
redisClient, err := rocsp_config.MakeClient(&conf.ROCSPTool.Redis, clk, metrics.NoopRegisterer)
Expand Down
5 changes: 4 additions & 1 deletion test/integration/caa_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"bytes"
"os"
"os/exec"
"strings"
"testing"

"github.com/letsencrypt/boulder/test"
Expand All @@ -28,7 +29,9 @@ func TestCAALogChecker(t *testing.T) {
stdErr := new(bytes.Buffer)
cmd.Stderr = stdErr
out, err := cmd.Output()
test.AssertEquals(t, string(out), "")
numLines := strings.Split(string(bytes.TrimSpace(out)), "\n")
test.AssertEquals(t, len(numLines), 1)
test.AssertContains(t, string(out), "Versions: caa-log-checker=(Unspecified Unspecified) Golang=(")
test.AssertEquals(t, stdErr.String(), "")
test.AssertNotError(t, err, "caa-log-checker failed")

Expand Down

0 comments on commit 4bd90ea

Please sign in to comment.