Skip to content

Commit

Permalink
Set stdout to output
Browse files Browse the repository at this point in the history
  • Loading branch information
杨赫然 committed Oct 18, 2024
1 parent acb315a commit 442f779
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion fileserver/fileserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,9 @@ func main() {
loadSeafileDB()
option.LoadFileServerOptions(centralDir)

if logFile == "" {
if logToStdout {
// Use default output (StdOut)
} else if logFile == "" {
absLogFile = filepath.Join(absDataDir, "fileserver.log")
fp, err := os.OpenFile(absLogFile, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0644)
if err != nil {
Expand Down Expand Up @@ -442,6 +444,9 @@ func handleUser1Signal() {
}

func logRotate() {
if logToStdout {
return
}
// reopen fileserver log
fp, err := os.OpenFile(absLogFile, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0644)
if err != nil {
Expand Down

0 comments on commit 442f779

Please sign in to comment.