Skip to content

Commit 25ac658

Browse files
committed
Add application name from version package to logger config
1 parent 1e76540 commit 25ac658

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/logger/loggerconfig.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package logger
66
import (
77
"os"
88

9+
"github.com/deploymenttheory/go-api-http-client/internal/version"
910
"go.uber.org/zap"
1011
"go.uber.org/zap/zapcore"
1112
)
@@ -40,7 +41,7 @@ func BuildLogger(logLevel LogLevel) Logger {
4041
},
4142
InitialFields: map[string]interface{}{ // specifies global contextual fields that should be included in every log entry produced by each logger created from the Config object
4243
"pid": os.Getpid(),
43-
"application": "your-application-name",
44+
"application": version.GetAppName(),
4445
},
4546
}
4647

0 commit comments

Comments
 (0)