Skip to content

Commit

Permalink
feat: fix property.json & log file pattern to include channel name (#339
Browse files Browse the repository at this point in the history
)
  • Loading branch information
plutoless authored Oct 17, 2024
1 parent 59df7b5 commit e1cf48e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/internal/http_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"log/slog"
"mime/multipart"
"net/http"
"net/url"
"os"
"path/filepath"
"strings"
Expand Down Expand Up @@ -460,10 +461,9 @@ func (s *HttpServer) processProperty(req *StartReq) (propertyJsonFile string, lo
}
}

channelNameMd5 := gmd5.MustEncryptString(req.ChannelName)
ts := time.Now().UnixNano()
propertyJsonFile = fmt.Sprintf("%s/property-%s-%d.json", s.config.LogPath, channelNameMd5, ts)
logFile = fmt.Sprintf("%s/app-%s-%d.log", s.config.LogPath, channelNameMd5, ts)
ts := time.Now().Format("20060102_150405_000")
propertyJsonFile = fmt.Sprintf("%s/property-%s-%s.json", s.config.LogPath, url.QueryEscape(req.ChannelName), ts)
logFile = fmt.Sprintf("%s/app-%s-%s.log", s.config.LogPath, url.QueryEscape(req.ChannelName), ts)
os.WriteFile(propertyJsonFile, []byte(propertyJson), 0644)

return
Expand Down

0 comments on commit e1cf48e

Please sign in to comment.