add log level option for suggest
This commit is contained in:
parent
2d97913fb5
commit
29315338df
2 changed files with 29 additions and 2 deletions
|
@ -51,6 +51,8 @@ public class SuggestJob {
|
|||
|
||||
protected String logFilePath;
|
||||
|
||||
protected String logLevel;
|
||||
|
||||
protected int retryCountToDeleteTempDir = 10;
|
||||
|
||||
protected long retryIntervalToDeleteTempDir = 5000;
|
||||
|
@ -65,6 +67,27 @@ public class SuggestJob {
|
|||
return this;
|
||||
}
|
||||
|
||||
public SuggestJob logFilePath(final String logFilePath) {
|
||||
this.logFilePath = logFilePath;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SuggestJob logLevel(final String logLevel) {
|
||||
this.logLevel = logLevel;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SuggestJob retryToDeleteTempDir(final int retryCount, final long retryInterval) {
|
||||
retryCountToDeleteTempDir = retryCount;
|
||||
retryIntervalToDeleteTempDir = retryInterval;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SuggestJob useLocaleElasticsearch(final boolean useLocaleElasticsearch) {
|
||||
this.useLocaleElasticsearch = useLocaleElasticsearch;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String execute(final JobExecutor jobExecutor) {
|
||||
jobExecutor(jobExecutor);
|
||||
return execute();
|
||||
|
@ -169,7 +192,11 @@ public class SuggestJob {
|
|||
}
|
||||
cmdList.add("-Dfess.log.path=" + logFilePath);
|
||||
addSystemProperty(cmdList, "fess.log.name", "fess-suggest", "-suggest");
|
||||
addSystemProperty(cmdList, "fess.log.level", null, null);
|
||||
if (logLevel == null) {
|
||||
addSystemProperty(cmdList, "fess.log.level", null, null);
|
||||
} else {
|
||||
cmdList.add("-Dfess.log.level=" + logLevel);
|
||||
}
|
||||
StreamUtil.of(fessConfig.getJvmSuggestOptionsAsArray()).filter(value -> StringUtil.isNotBlank(value))
|
||||
.forEach(value -> cmdList.add(value));
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{"index":{"_index":".fess_config","_type":"scheduled_job","_id":"default_crawler"}}
|
||||
{"name":"Default Crawler","target":"all","cronExpression":"0 0 0 * * ?","scriptType":"groovy","scriptData":"return container.getComponent(\"crawlJob\").logLevel(\"info\").execute(executor);","jobLogging":true,"crawler":true,"available":true,"sortOrder":1,"createdBy":"system","createdTime":0,"updatedBy":"system","updatedTime":0}
|
||||
{"index":{"_index":".fess_config","_type":"scheduled_job","_id":"suggest_indexer"}}
|
||||
{"name":"Suggest Indexer","target":"all","cronExpression":"0 0 0 * * ?","scriptType":"groovy","scriptData":"return container.getComponent(\"suggestJob\").execute(executor);","jobLogging":true,"crawler":false,"available":true,"sortOrder":2,"createdBy":"system","createdTime":0,"updatedBy":"system","updatedTime":0}
|
||||
{"name":"Suggest Indexer","target":"all","cronExpression":"0 0 0 * * ?","scriptType":"groovy","scriptData":"return container.getComponent(\"suggestJob\").logLevel(\"info\").execute(executor);","jobLogging":true,"crawler":false,"available":true,"sortOrder":2,"createdBy":"system","createdTime":0,"updatedBy":"system","updatedTime":0}
|
||||
{"index":{"_index":".fess_config","_type":"scheduled_job","_id":"log_aggregator"}}
|
||||
{"name":"Log Aggregator","target":"all","cronExpression":"0 * * * * ?","scriptType":"groovy","scriptData":"return container.getComponent(\"aggregateLogJob\").execute();","jobLogging":false,"crawler":false,"available":true,"sortOrder":3,"createdBy":"system","createdTime":0,"updatedBy":"system","updatedTime":0}
|
||||
{"index":{"_index":".fess_config","_type":"scheduled_job","_id":"log_purger"}}
|
||||
|
|
Loading…
Add table
Reference in a new issue