mirror of
https://github.com/kubenetworks/kubevpn.git
synced 2025-12-24 11:51:13 +08:00
hotfix: fix log rotate (#287)
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package action
|
||||
|
||||
import (
|
||||
"io"
|
||||
"log"
|
||||
|
||||
"github.com/hpcloud/tail"
|
||||
|
||||
"github.com/wencaiwulue/kubevpn/v2/pkg/daemon/rpc"
|
||||
@@ -8,7 +11,7 @@ import (
|
||||
|
||||
func (svr *Server) Logs(req *rpc.LogRequest, resp rpc.Daemon_LogsServer) error {
|
||||
path := GetDaemonLogPath()
|
||||
config := tail.Config{Follow: req.Follow, ReOpen: true, MustExist: true}
|
||||
config := tail.Config{Follow: req.Follow, ReOpen: false, MustExist: true, Logger: log.New(io.Discard, "", log.LstdFlags)}
|
||||
if !req.Follow {
|
||||
// FATAL -- cannot set ReOpen without Follow.
|
||||
config.ReOpen = false
|
||||
|
||||
Reference in New Issue
Block a user