mirror of
https://github.com/haiwen/seafile-server.git
synced 2025-09-02 16:04:26 +00:00
improve log (#498)
* improve log * write header after internal server error
This commit is contained in:
@@ -390,7 +390,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
// When logFile is "-", use default output (StdOut)
|
// When logFile is "-", use default output (StdOut)
|
||||||
|
|
||||||
log.SetFlags(log.Ldate | log.Ltime | log.Lshortfile)
|
log.SetFlags(log.Ldate | log.Ltime)
|
||||||
|
|
||||||
if absLogFile != "" {
|
if absLogFile != "" {
|
||||||
errorLogFile := filepath.Join(filepath.Dir(absLogFile), "fileserver-error.log")
|
errorLogFile := filepath.Join(filepath.Dir(absLogFile), "fileserver-error.log")
|
||||||
|
@@ -747,12 +747,12 @@ func getBlockInfo(rsp http.ResponseWriter, r *http.Request) *appError {
|
|||||||
|
|
||||||
blockLen := fmt.Sprintf("%d", blockSize)
|
blockLen := fmt.Sprintf("%d", blockSize)
|
||||||
rsp.Header().Set("Content-Length", blockLen)
|
rsp.Header().Set("Content-Length", blockLen)
|
||||||
rsp.WriteHeader(http.StatusOK)
|
|
||||||
if err := blockmgr.Read(storeID, blockID, rsp); err != nil {
|
if err := blockmgr.Read(storeID, blockID, rsp); err != nil {
|
||||||
return &appError{err, "", http.StatusInternalServerError}
|
return &appError{err, "", http.StatusInternalServerError}
|
||||||
}
|
}
|
||||||
|
|
||||||
sendStatisticMsg(storeID, user, "sync-file-download", uint64(blockSize))
|
sendStatisticMsg(storeID, user, "sync-file-download", uint64(blockSize))
|
||||||
|
rsp.WriteHeader(http.StatusOK)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user