From: Unknown Date: Tue, 25 Mar 2014 12:56:01 +0000 (-0400) Subject: Fix wrong serve command log location and commit repo action X-Git-Tag: v0.9.99~2320^2~12 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9aba29dd8f067338025593b7c409b494d4b0ce32;p=gitea.git Fix wrong serve command log location and commit repo action --- diff --git a/serve.go b/serve.go index 7e21fcae3a..bfd2663fc6 100644 --- a/serve.go +++ b/serve.go @@ -11,6 +11,7 @@ import ( "io" "os" "os/exec" + "path" "strconv" "strings" "time" @@ -47,8 +48,9 @@ gogs serv provide access auth for repositories`, func newLogger(execDir string) { level := "0" - os.MkdirAll("log", os.ModePerm) - log.NewLogger(10000, "file", fmt.Sprintf(`{"level":%s,"filename":"%s"}`, level, execDir+"/log/serv.log")) + logPath := execDir + "/log/serv.log" + os.MkdirAll(path.Dir(logPath), os.ModePerm) + log.NewLogger(10000, "file", fmt.Sprintf(`{"level":%s,"filename":"%s"}`, level, logPath)) log.Trace("start logging...") }