diff --git a/db/db.go b/db/db.go index dfd3d08..7a91e88 100644 --- a/db/db.go +++ b/db/db.go @@ -25,8 +25,12 @@ func Connect() *gorm.DB { if udb != nil { return udb } + logFile, err := os.OpenFile("db.log", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) + if err != nil { + panic(err) + } newLogger := logger.New( - log.New(os.Stdout, "\r\n", log.LstdFlags), + log.New(logFile, "\r\n", log.LstdFlags), logger.Config{ SlowThreshold: time.Second, LogLevel: logger.Error,