diff --git a/lnd.go b/lnd.go index 0561cdd3..ffd05fff 100644 --- a/lnd.go +++ b/lnd.go @@ -93,7 +93,11 @@ var ( // defers created in the top-level scope of a main method aren't executed if // os.Exit() is called. func lndMain() error { - defer ltndLog.Info("Shutdown complete") + defer func() { + if logRotatorPipe != nil { + ltndLog.Info("Shutdown complete") + } + }() // Load the configuration, and parse any command line options. This // function will also set up logging properly.