Skip to content

Commit

Permalink
cmd/icingadb: Log Icinga DB version during startup
Browse files Browse the repository at this point in the history
To better recognize the Icinga DB version used in case of errors, it is
now logged at startup.

If VCS is available during build, the current commit is included.
- Dirty VCS directory:
> 2024-03-11T14:36:29.317+0100    INFO    icingadb        Starting Icinga DB daemon (1.1.1-g0e9810c-dirty)
- Clean VCS directory:
> 2024-03-11T14:38:09.664+0100    INFO    icingadb        Starting Icinga DB daemon (1.1.1-geed8589)
- Build with `-buildvcs=false`:
> 2024-03-11T14:38:56.554+0100    INFO    icingadb        Starting Icinga DB daemon (1.1.1)

Closes #689.
  • Loading branch information
oxzi committed Mar 11, 2024
1 parent 0e9810c commit 3e5ca98
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/icingadb/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"
"github.com/go-redis/redis/v8"
"github.com/icinga/icingadb/internal"
"github.com/icinga/icingadb/internal/command"
"github.com/icinga/icingadb/pkg/common"
"github.com/icinga/icingadb/pkg/icingadb"
Expand Down Expand Up @@ -55,7 +56,7 @@ func run() int {
logger := logs.GetLogger()
defer logger.Sync()

logger.Info("Starting Icinga DB")
logger.Infof("Starting Icinga DB daemon (%s)", internal.Version.Version)

db, err := cmd.Database(logs.GetChildLogger("database"))
if err != nil {
Expand Down

0 comments on commit 3e5ca98

Please sign in to comment.