[build] Log launch command before starting ES
This commit is contained in:
parent
1f67ef2526
commit
19919a53a5
|
@ -258,6 +258,15 @@ class ClusterFormationTasks {
|
|||
|
||||
// this closure is the actual code to run elasticsearch
|
||||
Closure elasticsearchRunner = {
|
||||
// Command as string for logging
|
||||
String esCommandString = "Elasticsearch command: ${executable} "
|
||||
esCommandString += (esArgs + esProps).join(' ')
|
||||
if (esEnv.isEmpty() == false) {
|
||||
esCommandString += '\nenvironment:'
|
||||
esEnv.each { k, v -> esCommandString += "\n ${k}: ${v}" }
|
||||
}
|
||||
logger.info(esCommandString)
|
||||
|
||||
ByteArrayOutputStream buffer = new ByteArrayOutputStream()
|
||||
if (logger.isInfoEnabled() || config.daemonize == false) {
|
||||
// run with piping streams directly out (even stderr to stdout since gradle would capture it)
|
||||
|
@ -278,10 +287,9 @@ class ClusterFormationTasks {
|
|||
} else {
|
||||
logger.error("Couldn't start elasticsearch and couldn't find ${logFile}")
|
||||
}
|
||||
logger.error("Command: ${executable} ${(esArgs + esProps).join(' ')}")
|
||||
if (esEnv.isEmpty() == false) {
|
||||
logger.error('environment:')
|
||||
esEnv.each { k, v -> logger.error(" ${k}: ${v}")}
|
||||
if (logger.isInfoEnabled() == false) {
|
||||
// We already log the command at info level. No need to do it twice.
|
||||
logger.error(esCommandString)
|
||||
}
|
||||
throw new GradleException('Failed to start elasticsearch')
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue