commit
69a447b06e
68 changed files with 184 additions and 185 deletions
|
@ -177,7 +177,7 @@ public class JsonApiManager extends BaseJsonApiManager {
|
|||
}, OptionalThing.empty());
|
||||
response.flushBuffer();
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Loaded " + count + " docs");
|
||||
logger.debug("Loaded {} docs", count);
|
||||
}
|
||||
} catch (final Exception e) {
|
||||
final int status = 9;
|
||||
|
|
|
@ -79,12 +79,12 @@ public class AllJobScheduler implements LaJobScheduler {
|
|||
|
||||
TimeoutManager.getInstance().addTimeoutTarget(() -> {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Updating scheduled jobs. time:" + schedulerTime);
|
||||
logger.debug("Updating scheduled jobs. time:{}", schedulerTime);
|
||||
}
|
||||
final long now = System.currentTimeMillis();
|
||||
scheduledJobService.getScheduledJobListAfter(schedulerTime).forEach(scheduledJob -> {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Updating job schedule:" + scheduledJob.getName());
|
||||
logger.debug("Updating job schedule:{}", scheduledJob.getName());
|
||||
}
|
||||
try {
|
||||
jobHelper.register(scheduledJob);
|
||||
|
|
|
@ -70,7 +70,7 @@ public class ScriptExecutorJob implements LaJob {
|
|||
|
||||
if (!jobManager.findJobByUniqueOf(LaJobUnique.of(id)).isPresent()) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Job " + id + " is running.");
|
||||
logger.debug("Job {} is running.", id);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ public class ScriptExecutorJob implements LaJob {
|
|||
}
|
||||
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Starting Job " + id + ". scriptType: " + scriptType + ", script: " + script);
|
||||
logger.debug("Starting Job {}. scriptType: {}, script: {}" , id, scriptType, script);
|
||||
} else if (scheduledJob.isLoggingEnabled() && logger.isInfoEnabled()) {
|
||||
logger.info("Starting Job " + id + ".");
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ public class ScriptExecutorJob implements LaJob {
|
|||
}
|
||||
jobLog.setEndTime(ComponentUtil.getSystemHelper().getCurrentTimeAsLong());
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("jobLog: " + jobLog);
|
||||
logger.debug("jobLog: {}", jobLog);
|
||||
}
|
||||
if (scheduledJob.isLoggingEnabled()) {
|
||||
jobHelper.store(jobLog);
|
||||
|
|
|
@ -386,7 +386,7 @@ public class SearchLogService {
|
|||
}
|
||||
} catch (final Exception e) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Failed to parse " + pager.requestedTimeRange, e);
|
||||
logger.debug("Failed to parse {}", pager.requestedTimeRange, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -411,7 +411,7 @@ public class SearchLogService {
|
|||
}
|
||||
} catch (final Exception e) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Failed to parse " + pager.requestedTimeRange, e);
|
||||
logger.debug("Failed to parse {}", pager.requestedTimeRange, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -433,7 +433,7 @@ public class SearchLogService {
|
|||
}
|
||||
} catch (final Exception e) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Failed to parse " + pager.requestedTimeRange, e);
|
||||
logger.debug("Failed to parse {}", pager.requestedTimeRange, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -458,7 +458,7 @@ public class SearchLogService {
|
|||
}
|
||||
} catch (final Exception e) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Failed to parse " + pager.requestedTimeRange, e);
|
||||
logger.debug("Failed to parse {}", pager.requestedTimeRange, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -278,7 +278,7 @@ public class AdminBackupAction extends FessAdminAction {
|
|||
});
|
||||
} catch (final Exception e) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Failed to parse " + line, e);
|
||||
logger.debug("Failed to parse {}", line, e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -251,7 +251,7 @@ public class AdminMaintenanceAction extends FessAdminAction {
|
|||
zos.putNextEntry(entry);
|
||||
final long len = Files.copy(filePath, zos);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug(filePath.getFileName() + ": " + len);
|
||||
logger.debug("{}: {}", filePath.getFileName(), len);
|
||||
}
|
||||
} catch (final IOException e) {
|
||||
logger.warn("Failed to access " + filePath, e);
|
||||
|
|
|
@ -87,7 +87,7 @@ public class AdminPluginAction extends FessAdminAction {
|
|||
if (tempFile.exists() && !tempFile.delete()) {
|
||||
logger.warn("Failed to delete {}.", tempFile.getAbsolutePath());
|
||||
}
|
||||
logger.debug("Failed to copy " + filename, e);
|
||||
logger.debug("Failed to copy {}", filename, e);
|
||||
throwValidationError(messages -> messages.addErrorsFailedToInstallPlugin(GLOBAL, filename), () -> asListHtml());
|
||||
}
|
||||
new Thread(() -> {
|
||||
|
|
|
@ -134,7 +134,7 @@ public class GoAction extends FessSearchAction {
|
|||
try {
|
||||
final StreamResponse response = viewHelper.asContentResponse(doc);
|
||||
if (response.getHttpStatus().orElse(200) == 404) {
|
||||
logger.debug("Not found: " + targetUrl);
|
||||
logger.debug("Not found: {}", targetUrl);
|
||||
saveError(messages -> messages.addErrorsNotFoundOnFileSystem(GLOBAL, targetUrl));
|
||||
return redirect(ErrorAction.class);
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ public class FessCrawlerThread extends CrawlerThread {
|
|||
final String id = crawlingInfoHelper.generateId(dataMap);
|
||||
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Searching indexed document: " + id);
|
||||
logger.debug("Searching indexed document: {}", id);
|
||||
}
|
||||
final Map<String, Object> document =
|
||||
indexingHelper.getDocument(
|
||||
|
@ -115,7 +115,7 @@ public class FessCrawlerThread extends CrawlerThread {
|
|||
if (expires != null && expires.getTime() < System.currentTimeMillis()) {
|
||||
final Object idValue = document.get(fessConfig.getIndexFieldId());
|
||||
if (idValue != null && !indexingHelper.deleteDocument(fessEsClient, idValue.toString())) {
|
||||
logger.debug("Failed to delete expired document: " + url);
|
||||
logger.debug("Failed to delete expired document: {}", url);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -137,12 +137,12 @@ public class FessCrawlerThread extends CrawlerThread {
|
|||
|
||||
final int httpStatusCode = responseData.getHttpStatusCode();
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Accessing document: " + url + ", status: " + httpStatusCode);
|
||||
logger.debug("Accessing document: {}, status: {}", url, httpStatusCode);
|
||||
}
|
||||
if (httpStatusCode == 404) {
|
||||
storeChildUrlsToQueue(urlQueue, getAnchorSet(document.get(fessConfig.getIndexFieldAnchor())));
|
||||
if (!indexingHelper.deleteDocument(fessEsClient, id)) {
|
||||
logger.debug("Failed to delete 404 document: " + url);
|
||||
logger.debug("Failed to delete 404 document: {}", url);
|
||||
}
|
||||
return false;
|
||||
} else if (responseData.getLastModified() == null) {
|
||||
|
@ -162,7 +162,7 @@ public class FessCrawlerThread extends CrawlerThread {
|
|||
final Date documentExpires = crawlingInfoHelper.getDocumentExpires(crawlingConfig);
|
||||
if (documentExpires != null
|
||||
&& !indexingHelper.updateDocument(fessEsClient, id, fessConfig.getIndexFieldExpires(), documentExpires)) {
|
||||
logger.debug("Failed to update " + fessConfig.getIndexFieldExpires() + " at " + url);
|
||||
logger.debug("Failed to update {} at {}", fessConfig.getIndexFieldExpires(), url);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -223,7 +223,7 @@ public class FessCrawlerThread extends CrawlerThread {
|
|||
return null;
|
||||
}
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Found documents: " + docList);
|
||||
logger.debug("Found documents: {}", docList);
|
||||
}
|
||||
final Set<RequestData> urlSet = new HashSet<>(docList.size());
|
||||
for (final Map<String, Object> doc : docList) {
|
||||
|
|
|
@ -32,7 +32,7 @@ public class FessFileTransformer extends AbstractFessFileTransformer {
|
|||
@PostConstruct
|
||||
public void init() {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Initialize " + this.getClass().getSimpleName());
|
||||
logger.debug("Initialize {}", this.getClass().getSimpleName());
|
||||
}
|
||||
fessConfig = ComponentUtil.getFessConfig();
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ public class FessFileTransformer extends AbstractFessFileTransformer {
|
|||
}
|
||||
final Extractor extractor = extractorFactory.getExtractor(responseData.getMimeType());
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("url=" + responseData.getUrl() + ", extractor=" + extractor);
|
||||
logger.debug("url={}, extractor={}", responseData.getUrl(), extractor);
|
||||
}
|
||||
return extractor;
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ public class FessStandardTransformer extends AbstractFessFileTransformer {
|
|||
@PostConstruct
|
||||
public void init() {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Initialize " + this.getClass().getSimpleName());
|
||||
logger.debug("Initialize {}", this.getClass().getSimpleName());
|
||||
}
|
||||
fessConfig = ComponentUtil.getFessConfig();
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ public class FessStandardTransformer extends AbstractFessFileTransformer {
|
|||
}
|
||||
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("url=" + responseData.getUrl() + ", extractor=" + extractor);
|
||||
logger.debug("url={}, extractor={}", responseData.getUrl(), extractor);
|
||||
}
|
||||
return extractor;
|
||||
}
|
||||
|
|
|
@ -109,7 +109,7 @@ public class FessXpathTransformer extends XpathTransformer implements FessTransf
|
|||
@PostConstruct
|
||||
public void init() {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Initialize " + this.getClass().getSimpleName());
|
||||
logger.debug("Initialize {}", this.getClass().getSimpleName());
|
||||
}
|
||||
fessConfig = ComponentUtil.getFessConfig();
|
||||
}
|
||||
|
@ -331,7 +331,7 @@ public class FessXpathTransformer extends XpathTransformer implements FessTransf
|
|||
protected boolean isValidCanonicalUrl(final String url, final String canonicalUrl) {
|
||||
if (url.startsWith("https:") && canonicalUrl.startsWith("http:")) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Invalid Canonical Url(https->http): " + url + " -> " + canonicalUrl);
|
||||
logger.debug("Invalid Canonical Url(https->http): {} -> {}", url, canonicalUrl);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -786,16 +786,16 @@ public class FessXpathTransformer extends XpathTransformer implements FessTransf
|
|||
}
|
||||
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug(attrValue + " -> " + u);
|
||||
logger.debug("{} -> {}", attrValue, u);
|
||||
}
|
||||
if (StringUtil.isNotBlank(u)) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Add Child: " + u);
|
||||
logger.debug("Add Child: {}", u);
|
||||
}
|
||||
urlList.add(u);
|
||||
} else {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Skip Child: " + u);
|
||||
logger.debug("Skip Child: {}", u);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -840,7 +840,7 @@ public class FessXpathTransformer extends XpathTransformer implements FessTransf
|
|||
for (int i = 0; i < imgNodeList.getLength(); i++) {
|
||||
final Node imgNode = imgNodeList.item(i);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("img tag: " + imgNode);
|
||||
logger.debug("img tag: {}", imgNode);
|
||||
}
|
||||
final NamedNodeMap attributes = imgNode.getAttributes();
|
||||
final String thumbnailUrl = getThumbnailSrc(responseData.getUrl(), attributes);
|
||||
|
@ -854,7 +854,7 @@ public class FessXpathTransformer extends XpathTransformer implements FessTransf
|
|||
return thumbnailUrl;
|
||||
}
|
||||
} catch (final Exception e) {
|
||||
logger.debug("Failed to parse " + imgNode + " at " + responseData.getUrl(), e);
|
||||
logger.debug("Failed to parse {} at {}", imgNode, responseData.getUrl(), e);
|
||||
}
|
||||
} else if (firstThumbnailUrl == null) {
|
||||
firstThumbnailUrl = thumbnailUrl;
|
||||
|
@ -880,7 +880,7 @@ public class FessXpathTransformer extends XpathTransformer implements FessTransf
|
|||
}
|
||||
} catch (final Exception e) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Failed to parse thumbnail url for " + url + " : " + attributes, e);
|
||||
logger.debug("Failed to parse thumbnail url for {} : {}", url, attributes, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ public class DictionaryManager {
|
|||
@PostConstruct
|
||||
public void init() {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Initialize " + this.getClass().getSimpleName());
|
||||
logger.debug("Initialize {}", this.getClass().getSimpleName());
|
||||
}
|
||||
creatorList.forEach(creator -> {
|
||||
creator.setDictionaryManager(this);
|
||||
|
|
|
@ -57,7 +57,7 @@ public class DataStoreFactory {
|
|||
throw new IllegalArgumentException("name or dataStore is null.");
|
||||
}
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Loaded " + name);
|
||||
logger.debug("Loaded {}", name);
|
||||
}
|
||||
dataStoreMap.put(name.toLowerCase(Locale.ROOT), dataStore);
|
||||
dataStoreMap.put(dataStore.getClass().getSimpleName().toLowerCase(Locale.ROOT), dataStore);
|
||||
|
|
|
@ -75,7 +75,7 @@ public class FileListIndexUpdateCallbackImpl implements IndexUpdateCallback {
|
|||
|
||||
protected ExecutorService newFixedThreadPool(final int nThreads) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Executor Thread Pool: " + nThreads);
|
||||
logger.debug("Executor Thread Pool: {}", nThreads);
|
||||
}
|
||||
return new ThreadPoolExecutor(nThreads, nThreads, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(nThreads),
|
||||
new ThreadPoolExecutor.CallerRunsPolicy());
|
||||
|
@ -191,7 +191,7 @@ public class FileListIndexUpdateCallbackImpl implements IndexUpdateCallback {
|
|||
protected boolean deleteDocument(final Map<String, String> paramMap, final Map<String, Object> dataMap) {
|
||||
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Deleting " + dataMap);
|
||||
logger.debug("Deleting {}", dataMap);
|
||||
}
|
||||
|
||||
final FessConfig fessConfig = ComponentUtil.getFessConfig();
|
||||
|
@ -242,7 +242,7 @@ public class FileListIndexUpdateCallbackImpl implements IndexUpdateCallback {
|
|||
indexingHelper.deleteDocumentByUrl(fessEsClient, url);
|
||||
}
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Deleted " + deleteUrlList);
|
||||
logger.debug("Deleted {}", deleteUrlList);
|
||||
}
|
||||
deleteUrlList.clear();
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ public class IndexUpdateCallbackImpl implements IndexUpdateCallback {
|
|||
@PostConstruct
|
||||
public void init() {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Initialize " + this.getClass().getSimpleName());
|
||||
logger.debug("Initialize {}", this.getClass().getSimpleName());
|
||||
}
|
||||
maxDocumentRequestSize = ComponentUtil.getFessConfig().getIndexerDataMaxDocumentRequestSizeAsInteger().longValue();
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ public class IndexUpdateCallbackImpl implements IndexUpdateCallback {
|
|||
final FessEsClient fessEsClient = ComponentUtil.getFessEsClient();
|
||||
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Adding " + dataMap);
|
||||
logger.debug("Adding {}", dataMap);
|
||||
}
|
||||
|
||||
// required check
|
||||
|
@ -107,7 +107,7 @@ public class IndexUpdateCallbackImpl implements IndexUpdateCallback {
|
|||
synchronized (docList) {
|
||||
docList.add(dataMap);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Added the document. " + "The number of a document cache is " + docList.size() + ".");
|
||||
logger.debug("Added the document. The number of a document cache is {}.", docList.size());
|
||||
}
|
||||
|
||||
final Long contentLength = DocumentUtil.getValue(dataMap, fessConfig.getIndexFieldContentLength(), Long.class);
|
||||
|
@ -125,7 +125,7 @@ public class IndexUpdateCallbackImpl implements IndexUpdateCallback {
|
|||
documentSize.getAndIncrement();
|
||||
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("The number of an added document is " + documentSize.get() + ".");
|
||||
logger.debug("The number of an added document is {}.", documentSize.get());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -146,7 +146,7 @@ public class IndexUpdateCallbackImpl implements IndexUpdateCallback {
|
|||
final int count = searchLogHelper.getClickCount(url);
|
||||
doc.put(clickCountField, count);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Click Count: " + count + ", url: " + url);
|
||||
logger.debug("Click Count: {}, url: {}", count, url);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -155,7 +155,7 @@ public class IndexUpdateCallbackImpl implements IndexUpdateCallback {
|
|||
final long count = searchLogHelper.getFavoriteCount(url);
|
||||
doc.put(favoriteCountField, count);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Favorite Count: " + count + ", url: " + url);
|
||||
logger.debug("Favorite Count: {}, url: {}", count, url);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -233,7 +233,7 @@ public class FessEsClient implements Client {
|
|||
@PostConstruct
|
||||
public void open() {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Initialize " + this.getClass().getSimpleName());
|
||||
logger.debug("Initialize {}", this.getClass().getSimpleName());
|
||||
}
|
||||
final FessConfig fessConfig = ComponentUtil.getFessConfig();
|
||||
|
||||
|
@ -392,7 +392,7 @@ public class FessEsClient implements Client {
|
|||
logger.info("Created " + indexName + " index.");
|
||||
return true;
|
||||
} else if (logger.isDebugEnabled()) {
|
||||
logger.debug("Failed to create " + indexName + " index.");
|
||||
logger.debug("Failed to create {} index.", indexName);
|
||||
}
|
||||
} catch (final Exception e) {
|
||||
logger.warn(indexConfigFile + " is not found.", e);
|
||||
|
@ -433,7 +433,7 @@ public class FessEsClient implements Client {
|
|||
logger.warn("Failed to create " + indexName + "/" + docType + " mapping.", e);
|
||||
}
|
||||
} else if (logger.isDebugEnabled()) {
|
||||
logger.debug(indexName + "/" + docType + " mapping exists.");
|
||||
logger.debug("{}/{} mapping exists.", indexName, docType);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -480,7 +480,7 @@ public class FessEsClient implements Client {
|
|||
if (response.isAcknowledged()) {
|
||||
logger.info("Created " + aliasName + " alias for " + createdIndexName);
|
||||
} else if (logger.isDebugEnabled()) {
|
||||
logger.debug("Failed to create " + aliasName + " alias for " + createdIndexName);
|
||||
logger.debug("Failed to create {} alias for {}", aliasName, createdIndexName);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
@ -581,14 +581,14 @@ public class FessEsClient implements Client {
|
|||
client.admin().cluster().prepareHealth().setWaitForYellowStatus().execute()
|
||||
.actionGet(fessConfig.getIndexHealthTimeout());
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Elasticsearch Cluster Status: " + response.getStatus());
|
||||
logger.debug("Elasticsearch Cluster Status: {}", response.getStatus());
|
||||
}
|
||||
return;
|
||||
} catch (final Exception e) {
|
||||
cause = e;
|
||||
}
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Failed to access to Elasticsearch:" + i, cause);
|
||||
logger.debug("Failed to access to Elasticsearch:{}", i, cause);
|
||||
}
|
||||
try {
|
||||
Thread.sleep(1000L);
|
||||
|
@ -623,7 +623,7 @@ public class FessEsClient implements Client {
|
|||
cause = new FessSystemException("Configsync is not available.", e);
|
||||
}
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Failed to access to configsync:" + i, cause);
|
||||
logger.debug("Failed to access to configsync:{}", i, cause);
|
||||
}
|
||||
try {
|
||||
Thread.sleep(1000L);
|
||||
|
@ -779,7 +779,7 @@ public class FessEsClient implements Client {
|
|||
|
||||
try {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Query DSL:\n" + searchRequestBuilder.toString());
|
||||
logger.debug("Query DSL:\n{}", searchRequestBuilder.toString());
|
||||
}
|
||||
searchResponse = searchRequestBuilder.execute().actionGet(ComponentUtil.getFessConfig().getIndexSearchTimeout());
|
||||
} catch (final SearchPhaseExecutionException e) {
|
||||
|
@ -803,7 +803,7 @@ public class FessEsClient implements Client {
|
|||
String scrollId = null;
|
||||
try {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Query DSL:\n" + searchRequestBuilder.toString());
|
||||
logger.debug("Query DSL:\n{}", searchRequestBuilder.toString());
|
||||
}
|
||||
SearchResponse response = searchRequestBuilder.execute().actionGet(ComponentUtil.getFessConfig().getIndexSearchTimeout());
|
||||
|
||||
|
@ -1004,7 +1004,7 @@ public class FessEsClient implements Client {
|
|||
if (resp.isFailed() && resp.getFailure() != null) {
|
||||
final DocWriteRequest<?> req = requests.get(i);
|
||||
final Failure failure = resp.getFailure();
|
||||
logger.debug("Failed Request: " + req + "\n=>" + failure.getMessage());
|
||||
logger.debug("Failed Request: {}\n=>{}", req, failure.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ public class ScheduledJobBhv extends BsScheduledJobBhv {
|
|||
return super.selectByPK(id);
|
||||
} catch (final Exception e) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Failed to select a job by " + id, e);
|
||||
logger.debug("Failed to select a job by {}", id, e);
|
||||
}
|
||||
lastException = e;
|
||||
try {
|
||||
|
|
|
@ -400,7 +400,7 @@ public class DataConfig extends BsDataConfig implements CrawlingConfig {
|
|||
return Integer.parseInt(value);
|
||||
} catch (final NumberFormatException e) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Invalid format: " + value, e);
|
||||
logger.debug("Invalid format: {}", value, e);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
|
|
@ -53,7 +53,7 @@ public class ClickLogBhv extends BsClickLogBhv {
|
|||
final LocalDateTime date = LocalDateTime.ofInstant(instant, ZoneId.systemDefault());
|
||||
return date;
|
||||
} catch (final DateTimeParseException e) {
|
||||
logger.debug("Invalid date format: " + value, e);
|
||||
logger.debug("Invalid date format: {}", value, e);
|
||||
}
|
||||
}
|
||||
return DfTypeUtil.toLocalDateTime(value);
|
||||
|
|
|
@ -53,7 +53,7 @@ public class FavoriteLogBhv extends BsFavoriteLogBhv {
|
|||
final LocalDateTime date = LocalDateTime.ofInstant(instant, ZoneId.systemDefault());
|
||||
return date;
|
||||
} catch (final DateTimeParseException e) {
|
||||
logger.debug("Invalid date format: " + value, e);
|
||||
logger.debug("Invalid date format: {}", value, e);
|
||||
}
|
||||
}
|
||||
return DfTypeUtil.toLocalDateTime(value);
|
||||
|
|
|
@ -58,7 +58,7 @@ public class SearchLogBhv extends BsSearchLogBhv {
|
|||
final LocalDateTime date = LocalDateTime.ofInstant(instant, ZoneId.systemDefault());
|
||||
return date;
|
||||
} catch (final DateTimeParseException e) {
|
||||
logger.debug("Invalid date format: " + value, e);
|
||||
logger.debug("Invalid date format: {}", value, e);
|
||||
}
|
||||
}
|
||||
return DfTypeUtil.toLocalDateTime(value);
|
||||
|
|
|
@ -53,7 +53,7 @@ public class UserInfoBhv extends BsUserInfoBhv {
|
|||
final LocalDateTime date = LocalDateTime.ofInstant(instant, ZoneId.systemDefault());
|
||||
return date;
|
||||
} catch (final DateTimeParseException e) {
|
||||
logger.debug("Invalid date format: " + value, e);
|
||||
logger.debug("Invalid date format: {}", value, e);
|
||||
}
|
||||
}
|
||||
return DfTypeUtil.toLocalDateTime(value);
|
||||
|
|
|
@ -192,10 +192,10 @@ public class Crawler {
|
|||
|
||||
if (logger.isDebugEnabled()) {
|
||||
try {
|
||||
ManagementFactory.getRuntimeMXBean().getInputArguments().stream().forEach(s -> logger.debug("Parameter: " + s));
|
||||
System.getProperties().entrySet().stream().forEach(e -> logger.debug("Property: " + e.getKey() + "=" + e.getValue()));
|
||||
System.getenv().entrySet().forEach(e -> logger.debug("Env: " + e.getKey() + "=" + e.getValue()));
|
||||
logger.debug("Option: " + options);
|
||||
ManagementFactory.getRuntimeMXBean().getInputArguments().stream().forEach(s -> logger.debug("Parameter: {}", s));
|
||||
System.getProperties().entrySet().stream().forEach(e -> logger.debug("Property: {}={}", e.getKey(), e.getValue()));
|
||||
System.getenv().entrySet().forEach(e -> logger.debug("Env: {}={}", e.getKey(), e.getValue()));
|
||||
logger.debug("Option: {}", options);
|
||||
} catch (final Exception e) {
|
||||
// ignore
|
||||
}
|
||||
|
@ -237,7 +237,7 @@ public class Crawler {
|
|||
}
|
||||
command = reader.readLine().trim();
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Process command: " + command);
|
||||
logger.debug("Process command: {}", command);
|
||||
}
|
||||
if (Constants.CRAWLER_PROCESS_COMMAND_THREAD_DUMP.equals(command)) {
|
||||
ThreadDumpUtil.printThreadDump();
|
||||
|
@ -316,7 +316,7 @@ public class Crawler {
|
|||
try {
|
||||
final File propFile = ComponentUtil.getSystemHelper().createTempFile("crawler_", ".properties");
|
||||
if (propFile.delete() && logger.isDebugEnabled()) {
|
||||
logger.debug("Deleted a temp file: " + propFile.getAbsolutePath());
|
||||
logger.debug("Deleted a temp file: {}", propFile.getAbsolutePath());
|
||||
}
|
||||
systemProperties.reload(propFile.getAbsolutePath());
|
||||
propFile.deleteOnExit();
|
||||
|
|
|
@ -94,10 +94,10 @@ public class SuggestCreator {
|
|||
|
||||
if (logger.isDebugEnabled()) {
|
||||
try {
|
||||
ManagementFactory.getRuntimeMXBean().getInputArguments().stream().forEach(s -> logger.debug("Parameter: " + s));
|
||||
System.getProperties().entrySet().stream().forEach(e -> logger.debug("Property: " + e.getKey() + "=" + e.getValue()));
|
||||
System.getenv().entrySet().forEach(e -> logger.debug("Env: " + e.getKey() + "=" + e.getValue()));
|
||||
logger.debug("Option: " + options);
|
||||
ManagementFactory.getRuntimeMXBean().getInputArguments().stream().forEach(s -> logger.debug("Parameter: {}", s));
|
||||
System.getProperties().entrySet().stream().forEach(e -> logger.debug("Property: {}={}", e.getKey(), e.getValue()));
|
||||
System.getenv().entrySet().forEach(e -> logger.debug("Env: {}={}", e.getKey(), e.getValue()));
|
||||
logger.debug("Option: {}", options);
|
||||
} catch (final Exception e) {
|
||||
// ignore
|
||||
}
|
||||
|
@ -169,7 +169,7 @@ public class SuggestCreator {
|
|||
try {
|
||||
final File propFile = ComponentUtil.getSystemHelper().createTempFile("suggest_", ".properties");
|
||||
if (propFile.delete() && logger.isDebugEnabled()) {
|
||||
logger.debug("Deleted a temp file: " + propFile.getAbsolutePath());
|
||||
logger.debug("Deleted a temp file: {}", propFile.getAbsolutePath());
|
||||
}
|
||||
systemProperties.reload(propFile.getAbsolutePath());
|
||||
propFile.deleteOnExit();
|
||||
|
|
|
@ -102,10 +102,10 @@ public class ThumbnailGenerator {
|
|||
|
||||
if (logger.isDebugEnabled()) {
|
||||
try {
|
||||
ManagementFactory.getRuntimeMXBean().getInputArguments().stream().forEach(s -> logger.debug("Parameter: " + s));
|
||||
System.getProperties().entrySet().stream().forEach(e -> logger.debug("Property: " + e.getKey() + "=" + e.getValue()));
|
||||
System.getenv().entrySet().forEach(e -> logger.debug("Env: " + e.getKey() + "=" + e.getValue()));
|
||||
logger.debug("Option: " + options);
|
||||
ManagementFactory.getRuntimeMXBean().getInputArguments().stream().forEach(s -> logger.debug("Parameter: {}", s));
|
||||
System.getProperties().entrySet().stream().forEach(e -> logger.debug("Property: {}={}", e.getKey(), e.getValue()));
|
||||
System.getenv().entrySet().forEach(e -> logger.debug("Env: {}={}", e.getKey(), e.getValue()));
|
||||
logger.debug("Option: {}", options);
|
||||
} catch (final Exception e) {
|
||||
// ignore
|
||||
}
|
||||
|
@ -182,7 +182,7 @@ public class ThumbnailGenerator {
|
|||
try {
|
||||
final File propFile = ComponentUtil.getSystemHelper().createTempFile("thumbnail_", ".properties");
|
||||
if (propFile.delete() && logger.isDebugEnabled()) {
|
||||
logger.debug("Deleted a temp file: " + propFile.getAbsolutePath());
|
||||
logger.debug("Deleted a temp file: {}", propFile.getAbsolutePath());
|
||||
}
|
||||
systemProperties.reload(propFile.getAbsolutePath());
|
||||
propFile.deleteOnExit();
|
||||
|
|
|
@ -60,7 +60,7 @@ public class CorsFilter implements Filter {
|
|||
}
|
||||
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("HTTP Request: " + httpRequest.getMethod());
|
||||
logger.debug("HTTP Request: {}", httpRequest.getMethod());
|
||||
}
|
||||
|
||||
final FessConfig fessConfig = ComponentUtil.getFessConfig();
|
||||
|
@ -68,7 +68,7 @@ public class CorsFilter implements Filter {
|
|||
final String allowOrigin = getAllowOrigin(fessConfig, origin);
|
||||
if (StringUtil.isNotBlank(allowOrigin)) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("allowOrigin: " + allowOrigin);
|
||||
logger.debug("allowOrigin: {}", allowOrigin);
|
||||
}
|
||||
final HttpServletResponse httpResponse = (HttpServletResponse) response;
|
||||
httpResponse.addHeader(ACCESS_CONTROL_ALLOW_ORIGIN, allowOrigin);
|
||||
|
|
|
@ -66,7 +66,7 @@ public class CrawlingConfigHelper {
|
|||
@PostConstruct
|
||||
public void init() {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Initialize " + this.getClass().getSimpleName());
|
||||
logger.debug("Initialize {}", this.getClass().getSimpleName());
|
||||
}
|
||||
crawlingConfigCache = CacheBuilder.newBuilder().maximumSize(100).expireAfterWrite(10, TimeUnit.MINUTES).build();
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ public class DocumentHelper {
|
|||
@PostConstruct
|
||||
public void init() {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Initialize " + this.getClass().getSimpleName());
|
||||
logger.debug("Initialize {}", this.getClass().getSimpleName());
|
||||
}
|
||||
try {
|
||||
final TikaExtractor tikaExtractor = ComponentUtil.getComponent("tikaExtractor");
|
||||
|
@ -234,7 +234,7 @@ public class DocumentHelper {
|
|||
return ReaderUtil.readText(reader);
|
||||
} catch (final IOException e) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Failed to decode " + hash, e);
|
||||
logger.debug("Failed to decode {}", hash, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ public class DuplicateHostHelper {
|
|||
@PostConstruct
|
||||
public void init() {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Initialize " + this.getClass().getSimpleName());
|
||||
logger.debug("Initialize {}", this.getClass().getSimpleName());
|
||||
}
|
||||
if (duplicateHostList == null) {
|
||||
duplicateHostList = new ArrayList<>();
|
||||
|
|
|
@ -52,7 +52,7 @@ public class IndexingHelper {
|
|||
}
|
||||
final long execTime = System.currentTimeMillis();
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Sending " + docList.size() + " documents to a server.");
|
||||
logger.debug("Sending {} documents to a server.", docList.size());
|
||||
}
|
||||
try {
|
||||
if (fessConfig.isThumbnailCrawlerEnabled()) {
|
||||
|
@ -61,8 +61,8 @@ public class IndexingHelper {
|
|||
doc -> {
|
||||
if (!thumbnailManager.offer(doc)) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Removing " + doc.get(fessConfig.getIndexFieldThumbnail()) + " from "
|
||||
+ doc.get(fessConfig.getIndexFieldUrl()));
|
||||
logger.debug("Removing {} from {}", doc.get(fessConfig.getIndexFieldThumbnail()),
|
||||
doc.get(fessConfig.getIndexFieldUrl()));
|
||||
}
|
||||
doc.remove(fessConfig.getIndexFieldThumbnail());
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ public class IndexingHelper {
|
|||
}
|
||||
}
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug(queryBuilder.toString() + " => " + docs);
|
||||
logger.debug("{} => {}", queryBuilder.toString(), docs);
|
||||
}
|
||||
}
|
||||
if (!docIdList.isEmpty()) {
|
||||
|
|
|
@ -61,7 +61,7 @@ public class JobHelper {
|
|||
unregister(scheduledJob);
|
||||
} catch (final Exception e) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Failed to delete Job " + scheduledJob, e);
|
||||
logger.debug("Failed to delete Job {}", scheduledJob, e);
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
@ -176,7 +176,7 @@ public class JobHelper {
|
|||
if (jobLog.getEndTime() == null) {
|
||||
jobLog.setLastUpdated(ComponentUtil.getSystemHelper().getCurrentTimeAsLong());
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Update " + jobLog);
|
||||
logger.debug("Update {}", jobLog);
|
||||
}
|
||||
ComponentUtil.getComponent(JobLogBhv.class).insertOrUpdate(jobLog, op -> {
|
||||
op.setRefreshPolicy(Constants.TRUE);
|
||||
|
|
|
@ -54,7 +54,7 @@ public class KeyMatchHelper {
|
|||
@PostConstruct
|
||||
public void init() {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Initialize " + this.getClass().getSimpleName());
|
||||
logger.debug("Initialize {}", this.getClass().getSimpleName());
|
||||
}
|
||||
reload(0);
|
||||
}
|
||||
|
@ -77,11 +77,11 @@ public class KeyMatchHelper {
|
|||
keyMatch -> {
|
||||
final BoolQueryBuilder boolQuery = QueryBuilders.boolQuery();
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Loading KeyMatch Query: " + keyMatch.getQuery() + ", Size: " + keyMatch.getMaxSize());
|
||||
logger.debug("Loading KeyMatch Query: {}, Size: {}", keyMatch.getQuery(), keyMatch.getMaxSize());
|
||||
}
|
||||
getDocumentList(keyMatch).stream().map(doc -> {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Loaded KeyMatch doc: " + doc);
|
||||
logger.debug("Loaded KeyMatch doc: {}", doc);
|
||||
}
|
||||
return DocumentUtil.getValue(doc, fessConfig.getIndexFieldDocId(), String.class);
|
||||
}).forEach(docId -> {
|
||||
|
@ -90,7 +90,7 @@ public class KeyMatchHelper {
|
|||
|
||||
if (boolQuery.hasClauses()) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Loaded KeyMatch Boost Query: " + boolQuery);
|
||||
logger.debug("Loaded KeyMatch Boost Query: {}", boolQuery);
|
||||
}
|
||||
String virtualHost = keyMatch.getVirtualHost();
|
||||
if (StringUtil.isBlank(virtualHost)) {
|
||||
|
|
|
@ -48,7 +48,7 @@ public class LabelTypeHelper {
|
|||
@PostConstruct
|
||||
public void init() {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Initialize " + this.getClass().getSimpleName());
|
||||
logger.debug("Initialize {}", this.getClass().getSimpleName());
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
@ -258,20 +258,20 @@ public class LabelTypeHelper {
|
|||
if (includedPaths.matcher(path).matches()) {
|
||||
if (excludedPaths != null && excludedPaths.matcher(path).matches()) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Path " + path + " matched against the excludes paths expression " + excludedPaths.toString());
|
||||
logger.debug("Path {} matched against the excludes paths expression {}", path, excludedPaths.toString());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Path " + path + " wasn't matched against the include paths expression " + includedPaths.toString());
|
||||
logger.debug("Path {} wasn't matched against the include paths expression {}" , path, includedPaths.toString());
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
if (excludedPaths != null && excludedPaths.matcher(path).matches()) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Path " + path + " matched against the excludes paths expression " + excludedPaths.toString());
|
||||
logger.debug("Path {} matched against the excludes paths expression {}", path, excludedPaths.toString());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ public class LanguageHelper {
|
|||
@PostConstruct
|
||||
public void init() {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Initialize " + this.getClass().getSimpleName());
|
||||
logger.debug("Initialize {}", this.getClass().getSimpleName());
|
||||
}
|
||||
final FessConfig fessConfig = ComponentUtil.getFessConfig();
|
||||
langFields = fessConfig.getIndexerLanguageFieldsAsArray();
|
||||
|
|
|
@ -49,7 +49,7 @@ public class OpenSearchHelper {
|
|||
@PostConstruct
|
||||
public void init() {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Initialize " + this.getClass().getSimpleName());
|
||||
logger.debug("Initialize {}", this.getClass().getSimpleName());
|
||||
}
|
||||
if (StringUtil.isNotBlank(osddPath)) {
|
||||
final String path = LaServletContextUtil.getServletContext().getRealPath(osddPath);
|
||||
|
|
|
@ -52,7 +52,7 @@ public class PathMappingHelper {
|
|||
@PostConstruct
|
||||
public void init() {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Initialize " + this.getClass().getSimpleName());
|
||||
logger.debug("Initialize {}", this.getClass().getSimpleName());
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
|
|
@ -167,7 +167,7 @@ public class PermissionHelper {
|
|||
}
|
||||
}
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("smbUrl:" + responseData.getUrl() + " roleType:" + roleTypeList.toString());
|
||||
logger.debug("smbUrl:{} roleType:{}", responseData.getUrl(), roleTypeList.toString());
|
||||
}
|
||||
} else if (responseData.getUrl().startsWith("smb1:")) {
|
||||
final jcifs.smb1.smb1.SID[] allowedSids =
|
||||
|
@ -191,7 +191,7 @@ public class PermissionHelper {
|
|||
}
|
||||
}
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("smb1Url:" + responseData.getUrl() + " roleType:" + roleTypeList.toString());
|
||||
logger.debug("smb1Url:{} roleType:{}", responseData.getUrl(), roleTypeList.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -210,7 +210,7 @@ public class PermissionHelper {
|
|||
final String[] groups = (String[]) responseData.getMetaDataMap().get(FileSystemClient.FS_FILE_GROUPS);
|
||||
roleTypeList.addAll(stream(groups).get(stream -> stream.map(systemHelper::getSearchRoleByGroup).collect(Collectors.toList())));
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("fileUrl:" + responseData.getUrl() + " roleType:" + roleTypeList.toString());
|
||||
logger.debug("fileUrl:{} roleType:{}", responseData.getUrl(), roleTypeList.toString());
|
||||
}
|
||||
}
|
||||
return roleTypeList;
|
||||
|
@ -230,7 +230,7 @@ public class PermissionHelper {
|
|||
roleTypeList.add(systemHelper.getSearchRoleByGroup(group));
|
||||
}
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("ftpUrl:" + responseData.getUrl() + " roleType:" + roleTypeList.toString());
|
||||
logger.debug("ftpUrl:{} roleType:{}", responseData.getUrl(), roleTypeList.toString());
|
||||
}
|
||||
}
|
||||
return roleTypeList;
|
||||
|
|
|
@ -134,13 +134,13 @@ public class PluginHelper {
|
|||
final String actualVersion = version.replace("SNAPSHOT", snapshotVersion);
|
||||
list.add(new Artifact(name, actualVersion, pluginUrl + version + "/" + name + "-" + actualVersion + ".jar"));
|
||||
} else if (logger.isDebugEnabled()) {
|
||||
logger.debug("Snapshot name is not found: " + name + "/" + version);
|
||||
logger.debug("Snapshot name is not found: {}/{}", name, version);
|
||||
}
|
||||
} else {
|
||||
list.add(new Artifact(name, version, pluginUrl + version + "/" + name + "-" + version + ".jar"));
|
||||
}
|
||||
} else if (logger.isDebugEnabled()) {
|
||||
logger.debug(name + ":" + version + " is ignored.");
|
||||
logger.debug("{}:{} is ignored.", name, version);
|
||||
}
|
||||
}
|
||||
} catch (final Exception e) {
|
||||
|
@ -182,7 +182,7 @@ public class PluginHelper {
|
|||
|
||||
protected String getRepositoryContent(final String url) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Loading " + url);
|
||||
logger.debug("Loading {}", url);
|
||||
}
|
||||
try (final CurlResponse response = Curl.get(url).execute()) {
|
||||
return response.getContentAsString();
|
||||
|
|
|
@ -49,7 +49,7 @@ public class PopularWordHelper {
|
|||
@PostConstruct
|
||||
public void init() {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Initialize " + this.getClass().getSimpleName());
|
||||
logger.debug("Initialize {}", this.getClass().getSimpleName());
|
||||
}
|
||||
fessConfig = ComponentUtil.getFessConfig();
|
||||
cache =
|
||||
|
|
|
@ -140,7 +140,7 @@ public class QueryHelper {
|
|||
@PostConstruct
|
||||
public void init() {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Initialize " + this.getClass().getSimpleName());
|
||||
logger.debug("Initialize {}", this.getClass().getSimpleName());
|
||||
}
|
||||
final FessConfig fessConfig = ComponentUtil.getFessConfig();
|
||||
if (responseFields == null) {
|
||||
|
|
|
@ -46,7 +46,7 @@ public class RelatedContentHelper {
|
|||
@PostConstruct
|
||||
public void init() {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Initialize " + this.getClass().getSimpleName());
|
||||
logger.debug("Initialize {}", this.getClass().getSimpleName());
|
||||
}
|
||||
reload();
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ public class RelatedQueryHelper {
|
|||
@PostConstruct
|
||||
public void init() {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Initialize " + this.getClass().getSimpleName());
|
||||
logger.debug("Initialize {}", this.getClass().getSimpleName());
|
||||
}
|
||||
reload();
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ public class RoleQueryHelper {
|
|||
@PostConstruct
|
||||
public void init() {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Initialize " + this.getClass().getSimpleName());
|
||||
logger.debug("Initialize {}", this.getClass().getSimpleName());
|
||||
}
|
||||
stream(ComponentUtil.getFessConfig().getSearchDefaultPermissionsAsArray()).of(stream -> stream.forEach(name -> {
|
||||
defaultRoleList.add(name);
|
||||
|
@ -150,7 +150,7 @@ public class RoleQueryHelper {
|
|||
}
|
||||
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("roleSet: " + roleSet);
|
||||
logger.debug("roleSet: {}", roleSet);
|
||||
}
|
||||
|
||||
if (request != null) {
|
||||
|
@ -172,7 +172,7 @@ public class RoleQueryHelper {
|
|||
protected void processParameter(final HttpServletRequest request, final Set<String> roleSet) {
|
||||
final String parameter = request.getParameter(parameterKey);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug(parameterKey + ":" + parameter);
|
||||
logger.debug("{}:{}", parameterKey, parameter);
|
||||
}
|
||||
if (StringUtil.isNotEmpty(parameter)) {
|
||||
parseRoleSet(parameter, encryptedParameterValue, roleSet);
|
||||
|
@ -184,7 +184,7 @@ public class RoleQueryHelper {
|
|||
|
||||
final String parameter = request.getHeader(headerKey);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug(headerKey + ":" + parameter);
|
||||
logger.debug("{}:{}", headerKey, parameter);
|
||||
}
|
||||
if (StringUtil.isNotEmpty(parameter)) {
|
||||
parseRoleSet(parameter, encryptedHeaderValue, roleSet);
|
||||
|
@ -200,7 +200,7 @@ public class RoleQueryHelper {
|
|||
if (cookieKey.equals(cookie.getName())) {
|
||||
final String value = cookie.getValue();
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug(cookieKey + ":" + value);
|
||||
logger.debug("{}:{}", cookieKey, value);
|
||||
}
|
||||
if (StringUtil.isNotEmpty(value)) {
|
||||
parseRoleSet(value, encryptedCookieValue, roleSet);
|
||||
|
|
|
@ -51,7 +51,7 @@ public class SambaHelper {
|
|||
@PostConstruct
|
||||
public void init() {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Initialize " + this.getClass().getSimpleName());
|
||||
logger.debug("Initialize {}", this.getClass().getSimpleName());
|
||||
}
|
||||
fessConfig = ComponentUtil.getFessConfig();
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@ public class SearchLogHelper {
|
|||
@PostConstruct
|
||||
public void init() {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Initialize " + this.getClass().getSimpleName());
|
||||
logger.debug("Initialize {}", this.getClass().getSimpleName());
|
||||
}
|
||||
userInfoCache = CacheBuilder.newBuilder()//
|
||||
.maximumSize(userInfoCacheSize)//
|
||||
|
|
|
@ -86,7 +86,7 @@ public class SuggestHelper {
|
|||
@PostConstruct
|
||||
public void init() {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Initialize " + this.getClass().getSimpleName());
|
||||
logger.debug("Initialize {}", this.getClass().getSimpleName());
|
||||
}
|
||||
fessConfig = ComponentUtil.getFessConfig();
|
||||
split(fessConfig.getSuggestFieldContents(), ",").of(
|
||||
|
|
|
@ -108,7 +108,7 @@ public class SystemHelper {
|
|||
@PostConstruct
|
||||
public void init() {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Initialize " + this.getClass().getSimpleName());
|
||||
logger.debug("Initialize {}", this.getClass().getSimpleName());
|
||||
}
|
||||
updateSystemProperties();
|
||||
final FessConfig fessConfig = ComponentUtil.getFessConfig();
|
||||
|
@ -419,7 +419,7 @@ public class SystemHelper {
|
|||
protected String createSearchRole(final String type, final String name) {
|
||||
final String value = type + ComponentUtil.getFessConfig().getCanonicalLdapName(name);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Search Role: " + type + ":" + name + "=" + value);
|
||||
logger.debug("Search Role: {}:{}={}", type, name, value);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
|
|
@ -112,7 +112,7 @@ public class ThemeHelper {
|
|||
try (Stream<Path> walk = Files.walk(dir, FileVisitOption.FOLLOW_LINKS)) {
|
||||
walk.sorted(Comparator.reverseOrder()).forEach(f -> {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Deleting " + f);
|
||||
logger.debug("Deleting {}", f);
|
||||
}
|
||||
try {
|
||||
Files.delete(f);
|
||||
|
|
|
@ -157,7 +157,7 @@ public class ViewHelper {
|
|||
@PostConstruct
|
||||
public void init() {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Initialize " + this.getClass().getSimpleName());
|
||||
logger.debug("Initialize {}", this.getClass().getSimpleName());
|
||||
}
|
||||
final FessConfig fessConfig = ComponentUtil.getFessConfig();
|
||||
escapedHighlightPre = LaFunctions.h(originalHighlightTagPre);
|
||||
|
@ -628,7 +628,7 @@ public class ViewHelper {
|
|||
|
||||
public StreamResponse asContentResponse(final Map<String, Object> doc) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("writing the content of: " + doc);
|
||||
logger.debug("writing the content of: {}", doc);
|
||||
}
|
||||
final FessConfig fessConfig = ComponentUtil.getFessConfig();
|
||||
final CrawlingConfigHelper crawlingConfigHelper = ComponentUtil.getCrawlingConfigHelper();
|
||||
|
@ -675,7 +675,7 @@ public class ViewHelper {
|
|||
CloseableUtil.closeQuietly(responseData);
|
||||
}
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Finished to write " + url);
|
||||
logger.debug("Finished to write {}", url);
|
||||
}
|
||||
});
|
||||
return response;
|
||||
|
@ -719,7 +719,7 @@ public class ViewHelper {
|
|||
protected void writeContentType(final StreamResponse response, final ResponseData responseData) {
|
||||
final String mimeType = responseData.getMimeType();
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("mimeType: " + mimeType);
|
||||
logger.debug("mimeType: {}", mimeType);
|
||||
}
|
||||
if (mimeType == null) {
|
||||
response.contentTypeOctetStream();
|
||||
|
|
|
@ -193,7 +193,7 @@ public class WebFsIndexHelper {
|
|||
}
|
||||
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Crawling " + urlsStr);
|
||||
logger.debug("Crawling {}", urlsStr);
|
||||
}
|
||||
|
||||
crawler.setBackground(true);
|
||||
|
@ -326,7 +326,7 @@ public class WebFsIndexHelper {
|
|||
}
|
||||
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Crawling " + pathsStr);
|
||||
logger.debug("Crawling {}", pathsStr);
|
||||
}
|
||||
|
||||
crawler.setBackground(true);
|
||||
|
|
|
@ -318,7 +318,7 @@ public class IndexUpdater extends Thread {
|
|||
final long maxDocumentRequestSize = fessConfig.getIndexerWebfsMaxDocumentRequestSizeAsInteger().longValue();
|
||||
for (final EsAccessResult accessResult : arList) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Indexing " + accessResult.getUrl());
|
||||
logger.debug("Indexing {}", accessResult.getUrl());
|
||||
}
|
||||
accessResult.setStatus(Constants.DONE_STATUS);
|
||||
accessResultList.add(accessResult);
|
||||
|
@ -326,7 +326,7 @@ public class IndexUpdater extends Thread {
|
|||
if (accessResult.getHttpStatusCode() != 200) {
|
||||
// invalid page
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Skipped. The response code is " + accessResult.getHttpStatusCode() + ".");
|
||||
logger.debug("Skipped. The response code is {}.", accessResult.getHttpStatusCode());
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
@ -365,8 +365,8 @@ public class IndexUpdater extends Thread {
|
|||
final long processingTime = System.currentTimeMillis() - startTime;
|
||||
docList.addProcessingTime(processingTime);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Added the document(" + MemoryUtil.byteCountToDisplaySize(docList.getContentSize()) + ", "
|
||||
+ processingTime + "ms). " + "The number of a document cache is " + docList.size() + ".");
|
||||
logger.debug("Added the document({}, {}ms). " + "The number of a document cache is {}.",
|
||||
MemoryUtil.byteCountToDisplaySize(docList.getContentSize()), processingTime, docList.size());
|
||||
}
|
||||
|
||||
if (accessResult.getContentLength() == null) {
|
||||
|
@ -379,7 +379,7 @@ public class IndexUpdater extends Thread {
|
|||
}
|
||||
documentSize++;
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("The number of an added document is " + documentSize + ".");
|
||||
logger.debug("The number of an added document is {}.", documentSize);
|
||||
}
|
||||
} catch (final Exception e) {
|
||||
logger.warn("Could not add a doc: " + accessResult.getUrl(), e);
|
||||
|
@ -427,7 +427,7 @@ public class IndexUpdater extends Thread {
|
|||
final FessConfig fessConfig = ComponentUtil.getFessConfig();
|
||||
map.put(fessConfig.getIndexFieldBoost(), documentBoost);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Set a document boost (" + documentBoost + ").");
|
||||
logger.debug("Set a document boost ({}).", documentBoost);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -439,7 +439,7 @@ public class IndexUpdater extends Thread {
|
|||
final int count = searchLogHelper.getClickCount(url);
|
||||
doc.put(fessConfig.getIndexFieldClickCount(), count);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Click Count: " + count + ", url: " + url);
|
||||
logger.debug("Click Count: {}, url: {}", count, url);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -452,7 +452,7 @@ public class IndexUpdater extends Thread {
|
|||
final long count = searchLogHelper.getFavoriteCount(url);
|
||||
map.put(fessConfig.getIndexFieldFavoriteCount(), count);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Favorite Count: " + count + ", url: " + url);
|
||||
logger.debug("Favorite Count: {}, url: {}", count, url);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -465,7 +465,7 @@ public class IndexUpdater extends Thread {
|
|||
accessResultList.clear();
|
||||
final long time = System.currentTimeMillis() - execTime;
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Updated " + size + " access results. The execution time is " + time + "ms.");
|
||||
logger.debug("Updated {} access results. The execution time is {}ms.", size, time);
|
||||
}
|
||||
return time;
|
||||
}
|
||||
|
@ -523,12 +523,11 @@ public class IndexUpdater extends Thread {
|
|||
for (final String sessionId : finishedSessionIdList) {
|
||||
final long execTime2 = System.currentTimeMillis();
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Deleting document data: " + sessionId);
|
||||
logger.debug("Deleting document data: {}", sessionId);
|
||||
}
|
||||
deleteBySessionId(sessionId);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Deleted " + sessionId + " documents. The execution time is " + (System.currentTimeMillis() - execTime2)
|
||||
+ "ms.");
|
||||
logger.debug("Deleted {} documents. The execution time is {}ms.", sessionId, (System.currentTimeMillis() - execTime2));
|
||||
}
|
||||
}
|
||||
finishedSessionIdList.clear();
|
||||
|
|
|
@ -183,11 +183,11 @@ public class CrawlJob extends ExecJob {
|
|||
if (fessConfig.isSchedulerTarget(scheduledJob.getTarget())) {
|
||||
if (scheduledJob.isRunning()) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug(scheduledJob.getId() + " is running.");
|
||||
logger.debug("{} is running.", scheduledJob.getId());
|
||||
}
|
||||
counter.incrementAndGet();
|
||||
} else if (logger.isDebugEnabled()) {
|
||||
logger.debug(scheduledJob.getId() + " is not running.");
|
||||
logger.debug("{} is not running.", scheduledJob.getId());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -72,7 +72,7 @@ public class LdapManager {
|
|||
@PostConstruct
|
||||
public void init() {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Initialize " + this.getClass().getSimpleName());
|
||||
logger.debug("Initialize {}", this.getClass().getSimpleName());
|
||||
}
|
||||
fessConfig = ComponentUtil.getFessConfig();
|
||||
}
|
||||
|
@ -198,7 +198,7 @@ public class LdapManager {
|
|||
// AD: (&(objectClass=user)(sAMAccountName=%s))
|
||||
final String filter = String.format(accountFilter, ldapUser.getName());
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Account Filter: " + filter);
|
||||
logger.debug("Account Filter: {}", filter);
|
||||
}
|
||||
search(bindDn, filter, new String[] { fessConfig.getLdapMemberofAttribute() }, () -> ldapUser.getEnvironment(), result -> {
|
||||
processSearchRoles(result, entryDn -> {
|
||||
|
@ -211,7 +211,7 @@ public class LdapManager {
|
|||
});
|
||||
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("role: " + roleSet);
|
||||
logger.debug("role: {}", roleSet);
|
||||
}
|
||||
return roleSet.toArray(new String[roleSet.size()]);
|
||||
}
|
||||
|
@ -221,13 +221,13 @@ public class LdapManager {
|
|||
// (member:1.2.840.113556.1.4.1941:=%s)
|
||||
final String filter = String.format(groupFilter, dn);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Group Filter: " + filter);
|
||||
logger.debug("Group Filter: {}", filter);
|
||||
}
|
||||
search(bindDn, filter, null, () -> ldapUser.getEnvironment(), result -> {
|
||||
for (final SearchResult srcrslt : result) {
|
||||
final String groupDn = srcrslt.getNameInNamespace();
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("groupDn: " + groupDn);
|
||||
logger.debug("groupDn: {}", groupDn);
|
||||
}
|
||||
updateSearchRoles(roleSet, groupDn);
|
||||
}
|
||||
|
@ -276,7 +276,7 @@ public class LdapManager {
|
|||
final String entryDn = attrValue.toString();
|
||||
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("entryDn: " + entryDn);
|
||||
logger.debug("entryDn: {}", entryDn);
|
||||
}
|
||||
consumer.accept(entryDn);
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ public class FessUserLocaleProcessProvider implements UserLocaleProcessProvider
|
|||
try {
|
||||
return requestManager.getParameter(name).filter(StringUtil::isNotBlank).map(LocaleUtils::toLocale);
|
||||
} catch (final Exception e) {
|
||||
logger.debug("Failed to parse a value of " + name + ".", e);
|
||||
logger.debug("Failed to parse a value of {}.", name, e);
|
||||
}
|
||||
}
|
||||
return OptionalObject.empty();
|
||||
|
|
|
@ -68,7 +68,7 @@ public class GoogleAnalyticsScoreBooster extends ScoreBooster {
|
|||
@PostConstruct
|
||||
public void init() {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Initialize " + this.getClass().getSimpleName());
|
||||
logger.debug("Initialize {}", this.getClass().getSimpleName());
|
||||
}
|
||||
if (!Paths.get(keyFileLocation).toFile().exists()) {
|
||||
logger.info("GA Key File does not exist.");
|
||||
|
|
|
@ -114,7 +114,7 @@ public class AzureAdAuthenticator implements SsoAuthenticator {
|
|||
@PostConstruct
|
||||
public void init() {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Initialize " + this.getClass().getSimpleName());
|
||||
logger.debug("Initialize {}", this.getClass().getSimpleName());
|
||||
}
|
||||
ComponentUtil.getSsoManager().register(this);
|
||||
groupCache = CacheBuilder.newBuilder().expireAfterWrite(groupCacheExpiry, TimeUnit.SECONDS).build();
|
||||
|
|
|
@ -76,7 +76,7 @@ public class OpenIdConnectAuthenticator implements SsoAuthenticator {
|
|||
@PostConstruct
|
||||
public void init() {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Initialize " + this.getClass().getSimpleName());
|
||||
logger.debug("Initialize {}", this.getClass().getSimpleName());
|
||||
}
|
||||
ComponentUtil.getSsoManager().register(this);
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ public class SpnegoAuthenticator implements SsoAuthenticator {
|
|||
@PostConstruct
|
||||
public void init() {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Initialize " + this.getClass().getSimpleName());
|
||||
logger.debug("Initialize {}", this.getClass().getSimpleName());
|
||||
}
|
||||
ComponentUtil.getSsoManager().register(this);
|
||||
}
|
||||
|
@ -146,7 +146,7 @@ public class SpnegoAuthenticator implements SsoAuthenticator {
|
|||
}
|
||||
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("principal=" + principal);
|
||||
logger.debug("principal={}", principal);
|
||||
}
|
||||
|
||||
final String[] username = principal.getName().split("@", 2);
|
||||
|
|
|
@ -82,7 +82,7 @@ public class FessFunctions {
|
|||
return Files.getLastModifiedTime(path).toMillis();
|
||||
}
|
||||
} catch (final Exception e) {
|
||||
logger.debug("Failed to access " + key, e);
|
||||
logger.debug("Failed to access {}", key, e);
|
||||
}
|
||||
return 0L;
|
||||
}
|
||||
|
@ -328,7 +328,7 @@ public class FessFunctions {
|
|||
sb.append("?t=").append(value.toString());
|
||||
}
|
||||
} catch (final ExecutionException e) {
|
||||
logger.debug("Failed to access " + input, e);
|
||||
logger.debug("Failed to access {}", input, e);
|
||||
}
|
||||
}
|
||||
return LaResponseUtil.getResponse().encodeURL(sb.toString());
|
||||
|
|
|
@ -89,7 +89,7 @@ public class ThumbnailManager {
|
|||
@PostConstruct
|
||||
public void init() {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Initialize " + this.getClass().getSimpleName());
|
||||
logger.debug("Initialize {}", this.getClass().getSimpleName());
|
||||
}
|
||||
final String thumbnailPath = System.getProperty(Constants.FESS_THUMBNAIL_PATH);
|
||||
if (thumbnailPath != null) {
|
||||
|
@ -110,7 +110,7 @@ public class ThumbnailManager {
|
|||
}
|
||||
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Thumbnail Directory: " + baseDir.getAbsolutePath());
|
||||
logger.debug("Thumbnail Directory: {}", baseDir.getAbsolutePath());
|
||||
}
|
||||
|
||||
thumbnailTaskQueue = new LinkedBlockingQueue<>(thumbnailTaskQueueSize);
|
||||
|
@ -188,7 +188,7 @@ public class ThumbnailManager {
|
|||
});
|
||||
taskList.clear();
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Storing " + list.size() + " thumbnail tasks.");
|
||||
logger.debug("Storing {} thumbnail tasks.", list.size());
|
||||
}
|
||||
final ThumbnailQueueBhv thumbnailQueueBhv = ComponentUtil.getComponent(ThumbnailQueueBhv.class);
|
||||
thumbnailQueueBhv.batchInsert(list);
|
||||
|
@ -210,7 +210,7 @@ public class ThumbnailManager {
|
|||
idList.add(entity.getId());
|
||||
if (cleanup) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Removing thumbnail queue: " + entity);
|
||||
logger.debug("Removing thumbnail queue: {}", entity);
|
||||
}
|
||||
return null;
|
||||
} else {
|
||||
|
@ -235,7 +235,7 @@ public class ThumbnailManager {
|
|||
|
||||
protected void process(final FessConfig fessConfig, final ThumbnailQueue entity) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Processing thumbnail: " + entity);
|
||||
logger.debug("Processing thumbnail: {}", entity);
|
||||
}
|
||||
final String generatorName = entity.getGenerator();
|
||||
try {
|
||||
|
@ -259,7 +259,7 @@ public class ThumbnailManager {
|
|||
logger.warn(generatorName + " is not available.");
|
||||
}
|
||||
} else if (logger.isDebugEnabled()) {
|
||||
logger.debug("No image file exists: " + noImageFile.getAbsolutePath());
|
||||
logger.debug("No image file exists: {}", noImageFile.getAbsolutePath());
|
||||
}
|
||||
} catch (final Exception e) {
|
||||
logger.warn("Failed to create thumbnail for " + entity, e);
|
||||
|
@ -273,7 +273,7 @@ public class ThumbnailManager {
|
|||
final Tuple3<String, String, String> task = generator.createTask(path, docMap);
|
||||
if (task != null) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Add thumbnail task: " + task);
|
||||
logger.debug("Add thumbnail task: {}", task);
|
||||
}
|
||||
if (!thumbnailTaskQueue.offer(task)) {
|
||||
logger.warn("Failed to add thumbnail task: " + task);
|
||||
|
@ -284,7 +284,7 @@ public class ThumbnailManager {
|
|||
}
|
||||
}
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Thumbnail generator is not found: " + (docMap != null ? docMap.get("url") : docMap));
|
||||
logger.debug("Thumbnail generator is not found: {}", (docMap != null ? docMap.get("url") : docMap));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -320,7 +320,7 @@ public class ThumbnailManager {
|
|||
|
||||
public void add(final ThumbnailGenerator generator) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug(generator.getName() + " is available.");
|
||||
logger.debug("{} is available.", generator.getName());
|
||||
}
|
||||
if (generator.isAvailable()) {
|
||||
generatorList.add(generator);
|
||||
|
@ -393,7 +393,7 @@ public class ThumbnailManager {
|
|||
if (docId != null) {
|
||||
deleteFileMap.remove(docId);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Keep thumbnail: " + docId);
|
||||
logger.debug("Keep thumbnail: {}", docId);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -407,7 +407,7 @@ public class ThumbnailManager {
|
|||
try {
|
||||
Files.delete(path);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Delete " + path);
|
||||
logger.debug("Delete {}", path);
|
||||
}
|
||||
|
||||
Path parent = path.getParent();
|
||||
|
@ -424,7 +424,7 @@ public class ThumbnailManager {
|
|||
final String b = basePath.toUri().toString();
|
||||
final String id = s.replace(b, StringUtil.EMPTY).replace("." + imageExtention, StringUtil.EMPTY).replace("/", StringUtil.EMPTY);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Base: " + b + " File: " + s + " DocId: " + id);
|
||||
logger.debug("Base: {} File: {} DocId: {}", b, s, id);
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
@ -477,7 +477,7 @@ public class ThumbnailManager {
|
|||
if (directory.list() != null && directory.list().length == 0 && !THUMBNAILS_DIR_NAME.equals(directory.getName())) {
|
||||
Files.delete(dir);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Delete " + dir);
|
||||
logger.debug("Delete {}", dir);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -131,7 +131,7 @@ public abstract class BaseThumbnailGenerator implements ThumbnailGenerator {
|
|||
final String thumbnailId = DocumentUtil.getValue(docMap, fessConfig.getIndexFieldId(), String.class);
|
||||
final Tuple3<String, String, String> task = new Tuple3<>(getName(), thumbnailId, path);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Create thumbnail task: " + task);
|
||||
logger.debug("Create thumbnail task: {}", task);
|
||||
}
|
||||
return task;
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ public class CommandGenerator extends BaseThumbnailGenerator {
|
|||
@PostConstruct
|
||||
public void init() {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Initialize " + this.getClass().getSimpleName());
|
||||
logger.debug("Initialize {}", this.getClass().getSimpleName());
|
||||
}
|
||||
if (baseDir == null) {
|
||||
baseDir = new File(System.getProperty("java.io.tmpdir"));
|
||||
|
@ -67,12 +67,12 @@ public class CommandGenerator extends BaseThumbnailGenerator {
|
|||
@Override
|
||||
public boolean generate(final String thumbnailId, final File outputFile) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Generate Thumbnail: " + thumbnailId);
|
||||
logger.debug("Generate Thumbnail: {}", thumbnailId);
|
||||
}
|
||||
|
||||
if (outputFile.exists()) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("The thumbnail file exists: " + outputFile.getAbsolutePath());
|
||||
logger.debug("The thumbnail file exists: {}", outputFile.getAbsolutePath());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ public class CommandGenerator extends BaseThumbnailGenerator {
|
|||
}
|
||||
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Thumbnail File: " + outputPath);
|
||||
logger.debug("Thumbnail File: {}", outputPath);
|
||||
}
|
||||
return true;
|
||||
} catch (final Exception e) {
|
||||
|
@ -119,7 +119,7 @@ public class CommandGenerator extends BaseThumbnailGenerator {
|
|||
return false;
|
||||
} finally {
|
||||
if (tempFile != null && !tempFile.delete()) {
|
||||
logger.debug("Failed to delete " + tempFile.getAbsolutePath());
|
||||
logger.debug("Failed to delete {}", tempFile.getAbsolutePath());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -131,7 +131,7 @@ public class CommandGenerator extends BaseThumbnailGenerator {
|
|||
Process p = null;
|
||||
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Thumbnail Command: " + cmdList);
|
||||
logger.debug("Thumbnail Command: {}", cmdList);
|
||||
}
|
||||
|
||||
TimerTask task = null;
|
||||
|
|
|
@ -51,7 +51,7 @@ public class HtmlTagBasedGenerator extends BaseThumbnailGenerator {
|
|||
final String thumbnailId = DocumentUtil.getValue(docMap, fessConfig.getIndexFieldId(), String.class);
|
||||
final Tuple3<String, String, String> task = new Tuple3<>(getName(), thumbnailId, path);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Create thumbnail task: " + task);
|
||||
logger.debug("Create thumbnail task: {}", task);
|
||||
}
|
||||
return task;
|
||||
}
|
||||
|
@ -59,12 +59,12 @@ public class HtmlTagBasedGenerator extends BaseThumbnailGenerator {
|
|||
@Override
|
||||
public boolean generate(final String thumbnailId, final File outputFile) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Generate Thumbnail: " + thumbnailId);
|
||||
logger.debug("Generate Thumbnail: {}", thumbnailId);
|
||||
}
|
||||
|
||||
if (outputFile.exists()) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("The thumbnail file exists: " + outputFile.getAbsolutePath());
|
||||
logger.debug("The thumbnail file exists: {}", outputFile.getAbsolutePath());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ public class HtmlTagBasedGenerator extends BaseThumbnailGenerator {
|
|||
responseData -> {
|
||||
if (!isImageMimeType(responseData)) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Thumbnail is not image: " + thumbnailId + " : " + responseData.getUrl());
|
||||
logger.debug("Thumbnail is not image: {} : {}", thumbnailId, responseData.getUrl());
|
||||
}
|
||||
updateThumbnailField(thumbnailId, StringUtil.EMPTY);
|
||||
return false;
|
||||
|
@ -102,7 +102,7 @@ public class HtmlTagBasedGenerator extends BaseThumbnailGenerator {
|
|||
break;
|
||||
case NO_IMAGE:
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("No thumbnail: " + thumbnailId + " -> " + responseData.getUrl());
|
||||
logger.debug("No thumbnail: {} -> {}", thumbnailId, responseData.getUrl());
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -115,7 +115,7 @@ public class GsaConfigParser extends DefaultHandler {
|
|||
@Override
|
||||
public void startElement(final String uri, final String localName, final String qName, final Attributes attributes) throws SAXException {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Start Element: " + qName);
|
||||
logger.debug("Start Element: {}", qName);
|
||||
}
|
||||
if (tagQueue.isEmpty() && !"eef".equalsIgnoreCase(qName)) {
|
||||
throw new GsaConfigException("Invalid format.");
|
||||
|
@ -137,7 +137,7 @@ public class GsaConfigParser extends DefaultHandler {
|
|||
@Override
|
||||
public void endElement(final String uri, final String localName, final String qName) throws SAXException {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("End Element: " + qName);
|
||||
logger.debug("End Element: {}", qName);
|
||||
}
|
||||
if (GOOD_URLS.equalsIgnoreCase(qName)) {
|
||||
if (labelType != null) {
|
||||
|
@ -224,7 +224,7 @@ public class GsaConfigParser extends DefaultHandler {
|
|||
public void characters(final char[] ch, final int start, final int length) throws SAXException {
|
||||
final String text = new String(ch, start, length);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Text: " + text);
|
||||
logger.debug("Text: {}", text);
|
||||
}
|
||||
textBuf.append(text);
|
||||
}
|
||||
|
|
|
@ -177,7 +177,7 @@ public class QueryResponseList implements List<Map<String, Object>> {
|
|||
}
|
||||
} catch (final Exception e) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Could not create a highlighting value: " + docMap, e);
|
||||
logger.debug("Could not create a highlighting value: {}", docMap, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ public final class UpgradeUtil {
|
|||
logger.info("Created " + aliasName + " alias for " + indexName);
|
||||
return true;
|
||||
} else if (logger.isDebugEnabled()) {
|
||||
logger.debug("Failed to create " + aliasName + " alias for " + indexName);
|
||||
logger.debug("Failed to create {} alias for {}", aliasName, indexName);
|
||||
}
|
||||
}
|
||||
} catch (final ResourceNotFoundRuntimeException e) {
|
||||
|
|
|
@ -92,7 +92,7 @@ public class HtmlTagBasedGeneratorTest extends UnitFessTestCase {
|
|||
|
||||
private void assertImageSize(File file, int width, int height) throws IOException {
|
||||
BufferedImage img = ImageIO.read(file);
|
||||
logger.debug("width: " + img.getWidth() + ", height: " + img.getHeight());
|
||||
logger.debug("width: {}, height: {}", img.getWidth(), img.getHeight());
|
||||
assertEquals("Image Width", width, img.getWidth());
|
||||
assertEquals("Image Height", height, img.getHeight());
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue