Browse Source

修改日志文件格式

master
xyiege 3 months ago
parent
commit
959edd8642
  1. 7
      aufs/core/sendzip.go

7
aufs/core/sendzip.go

@ -6,6 +6,7 @@ import (
"net/http" "net/http"
"net/rpc/jsonrpc" "net/rpc/jsonrpc"
"os" "os"
"path/filepath"
"strings" "strings"
"time" "time"
) )
@ -111,9 +112,9 @@ func SendZip(w http.ResponseWriter, r *http.Request) {
// 自动升级的日志 // 自动升级的日志
func afsLog(zipblock ZipBlock) { func afsLog(zipblock ZipBlock) {
// 年月日格式文件夹 // 目录格式 2025/10
year, month, day := time.Now().Date() logdir := fmt.Sprintf("%d/%02d", time.Now().Year(), time.Now().Month())
logdir := fmt.Sprintf("%v/%v/%v", year, month, day) logdir = filepath.Join("logs", logdir)
// 日志文件 // 日志文件
logfile := fmt.Sprintf("%v/aufs.log", logdir) logfile := fmt.Sprintf("%v/aufs.log", logdir)
// 检查目录是否存在 // 检查目录是否存在

Loading…
Cancel
Save