修改日志文件夹名称为logs

修改访问日志级别为debug
This commit is contained in:
dushixiang 2021-03-19 23:47:23 +08:00
parent ecd780a6f4
commit d66d99dfaf

View File

@ -172,7 +172,7 @@ type Logrus struct {
func NewLogger() Logrus { func NewLogger() Logrus {
logFilePath := "" logFilePath := ""
if dir, err := os.Getwd(); err == nil { if dir, err := os.Getwd(); err == nil {
logFilePath = dir + "/log/" logFilePath = dir + "/logs/"
} }
if err := os.MkdirAll(logFilePath, 0755); err != nil { if err := os.MkdirAll(logFilePath, 0755); err != nil {
fmt.Println(err.Error()) fmt.Println(err.Error())
@ -235,7 +235,7 @@ func logrusMiddlewareHandler(c echo.Context, next echo.HandlerFunc) error {
"latency_human": stop.Sub(start).String(), "latency_human": stop.Sub(start).String(),
"bytes_in": bytesIn, "bytes_in": bytesIn,
"bytes_out": strconv.FormatInt(res.Size, 10), "bytes_out": strconv.FormatInt(res.Size, 10),
}).Info("Handled request") }).Debug("Handled request")
return nil return nil
} }