Skip to content

Commit

Permalink
Fix async log appender dont print when bookie start error
Browse files Browse the repository at this point in the history
  • Loading branch information
AnonHxy committed Jul 27, 2024
1 parent e5c418e commit 651998e
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.logging.log4j.LogManager;

/**
* A bookie server is a server that run bookie and serving rpc requests.
Expand Down Expand Up @@ -197,6 +198,9 @@ private static ServerConfiguration parseArgs(String[] args)
}

public static void main(String[] args) {
Runtime.getRuntime().addShutdownHook(
new Thread(LogManager::shutdown, "bookkeeper-shutdown")
);
int retCode = doMain(args);
Runtime.getRuntime().exit(retCode);
}
Expand Down

0 comments on commit 651998e

Please sign in to comment.