[VOL-2027] Included instanceId in log message
Change-Id: I83e54640169d9a010ea0a644e8e3ef8ed0663827
diff --git a/internal/pkg/afrouter/config.go b/internal/pkg/afrouter/config.go
index 6008199..09e1816 100644
--- a/internal/pkg/afrouter/config.go
+++ b/internal/pkg/afrouter/config.go
@@ -29,6 +29,10 @@
"path"
)
+const (
+ default_InstanceID = "arouter001"
+)
+
func ParseCmd() (*Configuration, error) {
config := &Configuration{}
cmdParse := flag.NewFlagSet(path.Base(os.Args[0]), flag.ContinueOnError)
@@ -44,11 +48,19 @@
}
//if(!cmdParse.Parsed()) {
//}
+
+ if val, have := os.LookupEnv("HOSTNAME"); have {
+ config.InstanceID = val
+ } else {
+ config.InstanceID = default_InstanceID
+ }
+
return config, nil
}
// Configuration file loading and parsing
type Configuration struct {
+ InstanceID string
ConfigFile *string
LogLevel *int
GrpcLog *bool