Browse Source

Make the same date time format for log files as in log package

Volodymyr Tkach 2 years ago
parent
commit
4a13dbbc1c
1 changed files with 2 additions and 2 deletions
  1. 2 2
      utils/http/logger/logger.go

+ 2 - 2
utils/http/logger/logger.go

@@ -63,13 +63,13 @@ func LogRequests(handler http.Handler) http.Handler {
 
 		if nw.Status < 400 {
 			if AccessLogFile != "" {
-				if err := appendToLogFile(AccessLogFile, start.Format(time.RFC3339)+" "+msg); err != nil {
+				if err := appendToLogFile(AccessLogFile, start.Format("2009/01/23 01:23:23")+" "+msg); err != nil {
 					log.Printf("%s\n", err.Error())
 				}
 			}
 		} else {
 			if ErrorLogFile != "" {
-				if err := appendToLogFile(ErrorLogFile, start.Format(time.RFC3339)+" "+msg); err != nil {
+				if err := appendToLogFile(ErrorLogFile, start.Format("2009/01/23 01:23:23")+" "+msg); err != nil {
 					log.Printf("%s\n", err.Error())
 				}
 			}