go-zero
go-zero copied to clipboard
when log mode config file or volume ,the program print to console
Describe the bug A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior, if applicable:
-
The code is
package main import ( "bookstore/api/internal/config" "bookstore/api/internal/handler" "bookstore/api/internal/svc" "flag" "fmt" "github.com/zeromicro/go-zero/core/logx" "github.com/zeromicro/go-zero/core/conf" "github.com/zeromicro/go-zero/rest" ) var configFile = flag.String("f", "etc/bookstore-api.yaml", "the config file") func main() { flag.Parse() var c config.Config conf.MustLoad(*configFile, &c) logx.Info("before logx =======") ctx := svc.NewServiceContext(c) server := rest.MustNewServer(c.RestConf) defer server.Stop() handler.RegisterHandlers(server, ctx) logx.Info("after logx =======") fmt.Printf("Starting server at %s:%d...\n", c.Host, c.Port) server.Start() }
Name: bookstore-api
Host: 0.0.0.0
Port: 8888
MaxConns: 10000
Timeout: 10000 #ms
MaxBytes: 104857600
Log:
Mode: file
Path: ../testdata/logs
Level: info
Compress: false
KeepDays: 7
-
The error is
when config logs mode is file or volume ,"after logx =======" not print into file
Expected behavior logs print into file not to console
Screenshots If applicable, add screenshots to help explain your problem.
Environments (please complete the following information):
gozero 1.3.5
More description Add any other context about the problem here.
Please try it in v1.4.0
v1.4.0 is ok
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.