aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/setting/setting.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go
index a8a31ddc7f..ec450b2c95 100644
--- a/modules/setting/setting.go
+++ b/modules/setting/setting.go
@@ -509,7 +509,10 @@ func newLogService() {
LogConfigs[i] = fmt.Sprintf(`{"level":%s}`, level)
case "file":
logPath := sec.Key("FILE_NAME").MustString(path.Join(LogRootPath, "gogs.log"))
- os.MkdirAll(path.Dir(logPath), os.ModePerm)
+ if err = os.MkdirAll(path.Dir(logPath), os.ModePerm); err != nil {
+ panic(err.Error())
+ }
+
LogConfigs[i] = fmt.Sprintf(
`{"level":%s,"filename":"%s","rotate":%v,"maxlines":%d,"maxsize":%d,"daily":%v,"maxdays":%d}`, level,
logPath,