We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 78fd976 commit 279e1a8Copy full SHA for 279e1a8
.gitignore
@@ -6,3 +6,4 @@ data
6
mocks
7
.idea
8
*vendor*
9
+*.log
utils/logger.go
@@ -7,10 +7,14 @@ import (
"go.uber.org/zap"
)
10
+const logFile = "app.log"
11
+
12
// NewLogger creates a new zap logger
13
func NewLogger() (*zap.Logger, error) {
14
if os.Getenv(environment.Environment) == "prod" {
- return zap.NewProduction()
15
+ cfg := zap.NewProductionConfig()
16
+ cfg.OutputPaths = []string{logFile, os.Stdout.Name()}
17
+ return cfg.Build()
18
}
19
return zap.NewDevelopment()
20
0 commit comments