diff --git a/middleware/middleware.go b/middleware/middleware.go index ec547a8..5779f13 100644 --- a/middleware/middleware.go +++ b/middleware/middleware.go @@ -61,6 +61,17 @@ func SetLogger(logger *gologger.Logger) { httpLogger = logger } +func StartLogging(filename, dir string) (err error) { + if httpLogger, err = gologger.New(filename, dir, gologger.MaxLogSize1MB); err != nil { + return err + } + return nil +} + +func CloseLogger() { + httpLogger.Close() +} + // LogHTTP ... func LogHTTP(h http.HandlerFunc) http.HandlerFunc { return func(w http.ResponseWriter, req *http.Request) {