diff options
author | Unknown <joe2010xtmf@163.com> | 2014-04-06 13:41:58 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-04-06 13:41:58 -0400 |
commit | 6a16866f4e0908e62c5e5b30e3dc0ef8e4cb0819 (patch) | |
tree | 80cfbd61c2bd872aa5750660861c10ef6cae5c22 | |
parent | 794cd27db3de55cce4c5d3716bf9e60fadaa86bc (diff) | |
download | gitea-6a16866f4e0908e62c5e5b30e3dc0ef8e4cb0819.tar.gz gitea-6a16866f4e0908e62c5e5b30e3dc0ef8e4cb0819.zip |
Fix bug related to log
-rw-r--r-- | conf/app.ini | 2 | ||||
-rw-r--r-- | modules/base/conf.go | 2 | ||||
-rw-r--r-- | serve.go | 3 | ||||
-rw-r--r-- | update.go | 3 |
4 files changed, 6 insertions, 4 deletions
diff --git a/conf/app.ini b/conf/app.ini index f88c750e09..43033eaa66 100644 --- a/conf/app.ini +++ b/conf/app.ini @@ -14,7 +14,7 @@ LICENSES = Apache v2 License|GPL v2|MIT License|Affero GPL|Artistic License 2.0| [server] PROTOCOL = http DOMAIN = localhost -ROOT_URL = %(PROTOCOL)://%(DOMAIN)s:%(HTTP_PORT)s/ +ROOT_URL = %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s/ HTTP_ADDR = HTTP_PORT = 3000 CERT_FILE = cert.pem diff --git a/modules/base/conf.go b/modules/base/conf.go index 4a6eec70a9..4285b52394 100644 --- a/modules/base/conf.go +++ b/modules/base/conf.go @@ -288,7 +288,7 @@ func NewConfigContext() { if err != nil { qlog.Fatalf("Fail to get home directory): %v\n", err) } - RepoRootPath = Cfg.MustValue("repository", "ROOT", filepath.Join(homeDir, "git/gogs-repositories")) + RepoRootPath = Cfg.MustValue("repository", "ROOT", filepath.Join(homeDir, "gogs-repositories")) if err = os.MkdirAll(RepoRootPath, os.ModePerm); err != nil { qlog.Fatalf("Fail to create RepoRootPath(%s): %v\n", RepoRootPath, err) } @@ -46,7 +46,8 @@ gogs serv provide access auth for repositories`, func newLogger(execDir string) { logPath := execDir + "/log/serv.log" os.MkdirAll(path.Dir(logPath), os.ModePerm) - f, err := os.Open(logPath) + + f, err := os.OpenFile(logPath, os.O_WRONLY|os.O_APPEND|os.O_CREATE, os.ModePerm) if err != nil { qlog.Fatal(err) } @@ -32,7 +32,8 @@ gogs serv provide access auth for repositories`, func newUpdateLogger(execDir string) { logPath := execDir + "/log/update.log" os.MkdirAll(path.Dir(logPath), os.ModePerm) - f, err := os.Open(logPath) + + f, err := os.OpenFile(logPath, os.O_WRONLY|os.O_APPEND|os.O_CREATE, os.ModePerm) if err != nil { qlog.Fatal(err) } |