diff --git a/code/client/main.go b/code/client/main.go index 212676f..a04cec7 100644 --- a/code/client/main.go +++ b/code/client/main.go @@ -34,6 +34,7 @@ func main() { cfg := global.LoadConf(*conf) logging.SetSizeRotate(cfg.LogDir, "np-cli", int(cfg.LogSize.Bytes()), cfg.LogRotate, true) + defer logging.Flush() conn, err := tls.Dial("tcp", cfg.Server, nil) runtime.Assert(err) diff --git a/code/server/main.go b/code/server/main.go index 83d66fe..4e25526 100644 --- a/code/server/main.go +++ b/code/server/main.go @@ -32,6 +32,7 @@ func main() { cfg := global.LoadConf(*conf) logging.SetSizeRotate(cfg.LogDir, "np-svr", int(cfg.LogSize.Bytes()), cfg.LogRotate, true) + defer logging.Flush() cert, err := tls.LoadX509KeyPair(cfg.TLSCrt, cfg.TLSKey) runtime.Assert(err)