Use ShutdownService to flush log.