Skip to content

Commit

Permalink
runtime: do not truncate logs on reload
Browse files Browse the repository at this point in the history
  • Loading branch information
labkode committed Sep 7, 2021
1 parent 183af2f commit 087c888
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions changelog/unreleased/fix-revad-logging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Bugfix: Do not truncate logs on restart

This change fixes the way log files were opened.
Before they were truncated and now the log file
will be open in append mode and created it if it
does not exist.

https://github.com/cs3org/reva/pull/2047
2 changes: 1 addition & 1 deletion cmd/revad/runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ func getWriter(out string) (io.Writer, error) {
return os.Stdout, nil
}

fd, err := os.Create(out)
fd, err := os.OpenFile(out, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
if err != nil {
err = errors.Wrap(err, "error creating log file: "+out)
return nil, err
Expand Down

0 comments on commit 087c888

Please sign in to comment.