This commit is contained in:
namhq1989 2022-08-23 16:10:31 +07:00
parent 140a51f39e
commit 3e6bfd4a18
1 changed files with 6 additions and 2 deletions

View File

@ -8,7 +8,11 @@ import (
type ( type (
// LogData for tracking // LogData for tracking
LogData map[string]interface{} LogData struct {
Source string
Message string
Data interface{}
}
) )
var ( var (
@ -19,7 +23,7 @@ var (
// Init ... // Init ...
func Init(appName, server string) { func Init(appName, server string) {
cfg := zap.Config{ cfg := zap.Config{
Encoding: "json", Encoding: "console",
Level: zap.NewAtomicLevelAt(zapcore.DebugLevel), Level: zap.NewAtomicLevelAt(zapcore.DebugLevel),
OutputPaths: []string{"stdout"}, OutputPaths: []string{"stdout"},
InitialFields: map[string]interface{}{"server": server, "capture": appName}, InitialFields: map[string]interface{}{"server": server, "capture": appName},