diff --git a/lnd.go b/lnd.go index e323e95d..f7dba152 100644 --- a/lnd.go +++ b/lnd.go @@ -93,12 +93,6 @@ var ( // defers created in the top-level scope of a main method aren't executed if // os.Exit() is called. func lndMain() error { - 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. loadedConfig, err := loadConfig() @@ -108,6 +102,7 @@ func lndMain() error { cfg = loadedConfig defer func() { if logRotator != nil { + ltndLog.Info("Shutdown complete") logRotator.Close() } }()