Replace + with params of logger

This commit is contained in:
Ryo Kuramoto 2019-10-24 23:15:17 +09:00
parent 12193d6864
commit 18d1fb3e27
No known key found for this signature in database
GPG key ID: F7A69369FE4CDA37
57 changed files with 156 additions and 156 deletions

View file

@ -179,7 +179,7 @@ public class EsApiManager extends BaseApiManager {
} catch (final ClientAbortException e) {
logger.debug("Client aborts this request.", e);
} catch (final IOException e) {
logger.error("Failed to read " + path + " from " + filePath);
logger.error("Failed to read {} from {}", path, filePath);
throw new WebApiException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e);
}
} else {
@ -189,7 +189,7 @@ public class EsApiManager extends BaseApiManager {
} catch (final ClientAbortException e) {
logger.debug("Client aborts this request.", e);
} catch (final IOException e) {
logger.error("Failed to read " + path + " from " + filePath);
logger.error("Failed to read {} from {}", path, filePath);
throw new WebApiException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e);
}
}

View file

@ -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;

View file

@ -89,7 +89,7 @@ public class AllJobScheduler implements LaJobScheduler {
try {
jobHelper.register(scheduledJob);
} catch (final Exception e) {
logger.warn("Failed to update schdule " + scheduledJob, e);
logger.warn("Failed to update schdule {}", scheduledJob, e);
}
});
schedulerTime = now;

View file

@ -54,7 +54,7 @@ public class ScriptExecutorJob implements LaJob {
final JobHelper jobHelper = ComponentUtil.getJobHelper();
if (!jobHelper.isAvailable(id)) {
logger.info("Job " + id + " is unavailable. Unregistering this job.");
logger.info("Job {} is unavailable. Unregistering this job.", id);
jobHelper.unregister(scheduledJob);
return;
}
@ -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;
}
@ -85,13 +85,13 @@ public class ScriptExecutorJob implements LaJob {
if (logger.isDebugEnabled()) {
logger.debug("Starting Job " + id + ". scriptType: " + scriptType + ", script: " + script);
} else if (scheduledJob.isLoggingEnabled() && logger.isInfoEnabled()) {
logger.info("Starting Job " + id + ".");
logger.info("Starting Job {}.", id);
}
final Object ret = jobExecutor.execute(script);
if (ret == null) {
if (scheduledJob.isLoggingEnabled() && logger.isInfoEnabled()) {
logger.info("Finished Job " + id + ".");
logger.info("Finished Job {}.", id);
}
} else {
if (scheduledJob.isLoggingEnabled() && logger.isInfoEnabled()) {
@ -109,7 +109,7 @@ public class ScriptExecutorJob implements LaJob {
try {
task.stop();
} catch (final Exception e) {
logger.warn("Failed to stop " + jobLog, e);
logger.warn("Failed to stop {}", jobLog, e);
}
}
jobLog.setEndTime(ComponentUtil.getSystemHelper().getCurrentTimeAsLong());

View file

@ -124,7 +124,7 @@ public class ScheduledJobService {
try {
ComponentUtil.getJobHelper().register(cron, scheduledJob);
} catch (final Exception e) {
logger.error("Failed to start Job " + scheduledJob.getId(), e);
logger.error("Failed to start Job {}", scheduledJob.getId(), e);
}
});
}

View file

@ -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);
}
}
}

View file

@ -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;
}
@ -364,7 +364,7 @@ public class AdminBackupAction extends FessAdminAction {
writeCall.accept(writer);
writer.flush();
} catch (final Exception e) {
logger.warn("Failed to write " + id + " to response.", e);
logger.warn("Failed to write {} to response.", id, e);
}
});
}

View file

@ -172,7 +172,7 @@ public class AdminDesignAction extends FessAdminAction {
final File parentFile = uploadFile.getParentFile();
if (!parentFile.exists() && !parentFile.mkdirs()) {
logger.warn("Could not create " + parentFile.getAbsolutePath());
logger.warn("Could not create {}", parentFile.getAbsolutePath());
}
try {

View file

@ -88,7 +88,7 @@ public class AdminEsreqAction extends FessAdminAction {
CopyUtil.copy(in, tempFile);
} catch (final Exception e1) {
if (tempFile != null && tempFile.exists() && !tempFile.delete()) {
logger.warn("Failed to delete " + tempFile.getAbsolutePath());
logger.warn("Failed to delete {}", tempFile.getAbsolutePath());
}
throw e1;
}
@ -97,7 +97,7 @@ public class AdminEsreqAction extends FessAdminAction {
out.write(in);
} finally {
if (tempFile.exists() && !tempFile.delete()) {
logger.warn("Failed to delete " + tempFile.getAbsolutePath());
logger.warn("Failed to delete {}", tempFile.getAbsolutePath());
}
}
});

View file

@ -176,7 +176,7 @@ public class AdminGroupAction extends FessAdminAction {
groupService.store(entity);
saveInfo(messages -> messages.addSuccessCrudCreateCrudTable(GLOBAL));
} catch (final Exception e) {
logger.error("Failed to add " + entity, e);
logger.error("Failed to add {}", entity, e);
throwValidationError(messages -> messages.addErrorsCrudFailedToCreateCrudTable(GLOBAL, buildThrowableMessage(e)),
() -> asEditHtml());
}
@ -197,7 +197,7 @@ public class AdminGroupAction extends FessAdminAction {
groupService.store(entity);
saveInfo(messages -> messages.addSuccessCrudUpdateCrudTable(GLOBAL));
} catch (final Exception e) {
logger.error("Failed to update " + entity, e);
logger.error("Failed to update {}", entity, e);
throwValidationError(messages -> messages.addErrorsCrudFailedToUpdateCrudTable(GLOBAL, buildThrowableMessage(e)),
() -> asEditHtml());
}
@ -221,7 +221,7 @@ public class AdminGroupAction extends FessAdminAction {
groupService.delete(entity);
saveInfo(messages -> messages.addSuccessCrudDeleteCrudTable(GLOBAL));
} catch (final Exception e) {
logger.error("Failed to delete " + entity, e);
logger.error("Failed to delete {}", entity, e);
throwValidationError(
messages -> messages.addErrorsCrudFailedToDeleteCrudTable(GLOBAL, buildThrowableMessage(e)),
() -> asDetailsHtml());

View file

@ -113,15 +113,15 @@ public class AdminMaintenanceAction extends FessAdminAction {
.execute(
ActionListener.wrap(
res -> {
logger.info("Close " + docIndex);
logger.info("Close {}", docIndex);
fessEsClient
.admin()
.indices()
.prepareOpen(docIndex)
.execute(
ActionListener.wrap(res2 -> logger.info("Open " + docIndex),
e -> logger.warn("Failed to open " + docIndex, e)));
}, e -> logger.warn("Failed to close " + docIndex, e)));
ActionListener.wrap(res2 -> logger.info("Open {}", docIndex),
e -> logger.warn("Failed to open {}", docIndex, e)));
}, e -> logger.warn("Failed to close {}", docIndex, e)));
saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
return redirect(getClass());
}
@ -183,7 +183,7 @@ public class AdminMaintenanceAction extends FessAdminAction {
CopyUtil.copy(response.getContentAsStream(), zos);
}
} catch (final Exception e) {
logger.warn("Failed to access /_" + v1 + "/" + v2, e);
logger.warn("Failed to access /_{}/{}", v1, v2, e);
}
}
@ -196,7 +196,7 @@ public class AdminMaintenanceAction extends FessAdminAction {
CopyUtil.copy(response.getContentAsStream(), zos);
}
} catch (final Exception e) {
logger.warn("Failed to access /_cat/" + name, e);
logger.warn("Failed to access /_cat/{}", name, e);
}
});
}
@ -254,7 +254,7 @@ public class AdminMaintenanceAction extends FessAdminAction {
logger.debug(filePath.getFileName() + ": " + len);
}
} catch (final IOException e) {
logger.warn("Failed to access " + filePath, e);
logger.warn("Failed to access {}", filePath, e);
}
});
} catch (final Exception e) {
@ -298,9 +298,9 @@ public class AdminMaintenanceAction extends FessAdminAction {
fessEsClient.addMapping(docIndex, "doc", toIndex);
fessEsClient.reindex(fromIndex, toIndex, replaceAliases);
if (replaceAliases && !fessEsClient.updateAlias(toIndex)) {
logger.warn("Failed to update aliases for " + fromIndex + " and " + toIndex);
logger.warn("Failed to update aliases for {} and {}", fromIndex, toIndex);
}
}, e -> logger.warn("Failed to reindex from " + fromIndex + " to " + toIndex, e)));
}, e -> logger.warn("Failed to reindex from {} to {}", fromIndex, toIndex, e)));
return true;
}
saveError(messages -> messages.addErrorsFailedToReindex(GLOBAL, fromIndex, toIndex));

View file

@ -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(() -> {
@ -97,7 +97,7 @@ public class AdminPluginAction extends FessAdminAction {
pluginHelper.getArtifactFromFileName(ArtifactType.UNKNOWN, filename, tempFile.getAbsolutePath());
pluginHelper.installArtifact(artifact);
} catch (final Exception e) {
logger.warn("Failed to install " + filename, e);
logger.warn("Failed to install {}", filename, e);
} finally {
if (tempFile.exists() && !tempFile.delete()) {
logger.warn("Failed to delete {}.", tempFile.getAbsolutePath());
@ -178,14 +178,14 @@ public class AdminPluginAction extends FessAdminAction {
try {
pluginHelper.installArtifact(artifact);
} catch (final Exception e) {
logger.warn("Failed to install " + artifact.getFileName(), e);
logger.warn("Failed to install {}", artifact.getFileName(), e);
}
for (final Artifact a : artifacts) {
if (a.getName().equals(artifact.getName()) && !a.getVersion().equals(artifact.getVersion())) {
try {
pluginHelper.deleteInstalledArtifact(a);
} catch (final Exception e) {
logger.warn("Failed to delete " + a.getFileName(), e);
logger.warn("Failed to delete {}", a.getFileName(), e);
}
}
}
@ -197,7 +197,7 @@ public class AdminPluginAction extends FessAdminAction {
try {
ComponentUtil.getPluginHelper().deleteInstalledArtifact(artifact);
} catch (final Exception e) {
logger.warn("Failed to delete " + artifact.getFileName(), e);
logger.warn("Failed to delete {}", artifact.getFileName(), e);
}
}).start();
}

View file

@ -156,7 +156,7 @@ public class AdminRoleAction extends FessAdminAction {
roleService.store(entity);
saveInfo(messages -> messages.addSuccessCrudCreateCrudTable(GLOBAL));
} catch (final Exception e) {
logger.error("Failed to add " + entity, e);
logger.error("Failed to add {}", entity, e);
throwValidationError(messages -> messages.addErrorsCrudFailedToCreateCrudTable(GLOBAL, buildThrowableMessage(e)),
() -> asEditHtml());
}
@ -177,7 +177,7 @@ public class AdminRoleAction extends FessAdminAction {
roleService.delete(entity);
saveInfo(messages -> messages.addSuccessCrudDeleteCrudTable(GLOBAL));
} catch (final Exception e) {
logger.error("Failed to delete " + entity, e);
logger.error("Failed to delete {}", entity, e);
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), () -> asDetailsHtml());
}
}).orElse(() -> {

View file

@ -266,7 +266,7 @@ public class AdminSearchlistAction extends FessAdminAction {
fessEsClient.store(index, entity);
saveInfo(messages -> messages.addSuccessCrudCreateCrudTable(GLOBAL));
} catch (final Exception e) {
logger.error("Failed to add " + entity, e);
logger.error("Failed to add {}", entity, e);
throwValidationError(messages -> messages.addErrorsCrudFailedToCreateCrudTable(GLOBAL, buildThrowableMessage(e)),
() -> asEditHtml());
}
@ -303,7 +303,7 @@ public class AdminSearchlistAction extends FessAdminAction {
fessEsClient.store(index, entity);
saveInfo(messages -> messages.addSuccessCrudUpdateCrudTable(GLOBAL));
} catch (final Exception e) {
logger.error("Failed to update " + entity, e);
logger.error("Failed to update {}", entity, e);
throwValidationError(messages -> messages.addErrorsCrudFailedToUpdateCrudTable(GLOBAL, buildThrowableMessage(e)),
() -> asEditHtml());
}

View file

@ -200,7 +200,7 @@ public class AdminUserAction extends FessAdminAction {
userService.store(entity);
saveInfo(messages -> messages.addSuccessCrudCreateCrudTable(GLOBAL));
} catch (final Exception e) {
logger.error("Failed to add " + entity, e);
logger.error("Failed to add {}", entity, e);
throwValidationError(messages -> messages.addErrorsCrudFailedToCreateCrudTable(GLOBAL, buildThrowableMessage(e)),
() -> asEditHtml());
}
@ -222,7 +222,7 @@ public class AdminUserAction extends FessAdminAction {
userService.store(entity);
saveInfo(messages -> messages.addSuccessCrudUpdateCrudTable(GLOBAL));
} catch (final Exception e) {
logger.error("Failed to update " + entity, e);
logger.error("Failed to update {}", entity, e);
throwValidationError(messages -> messages.addErrorsCrudFailedToUpdateCrudTable(GLOBAL, buildThrowableMessage(e)),
() -> asEditHtml());
}
@ -251,7 +251,7 @@ public class AdminUserAction extends FessAdminAction {
userService.delete(entity);
saveInfo(messages -> messages.addSuccessCrudDeleteCrudTable(GLOBAL));
} catch (final Exception e) {
logger.error("Failed to delete " + entity, e);
logger.error("Failed to delete {}", entity, e);
throwValidationError(
messages -> messages.addErrorsCrudFailedToDeleteCrudTable(GLOBAL, buildThrowableMessage(e)),
() -> asDetailsHtml());

View file

@ -133,7 +133,7 @@ public class ApiAdminSearchlistAction extends FessApiAdminAction {
fessEsClient.store(index, entity);
saveInfo(messages -> messages.addSuccessCrudCreateCrudTable(GLOBAL));
} catch (final Exception e) {
logger.error("Failed to add " + entity, e);
logger.error("Failed to add {}", entity, e);
throwValidationErrorApi(messages -> messages.addErrorsCrudFailedToCreateCrudTable(GLOBAL, buildThrowableMessage(e)));
}
return entity;
@ -174,7 +174,7 @@ public class ApiAdminSearchlistAction extends FessApiAdminAction {
fessEsClient.store(index, entity);
saveInfo(messages -> messages.addSuccessCrudUpdateCrudTable(GLOBAL));
} catch (final Exception e) {
logger.error("Failed to update " + entity, e);
logger.error("Failed to update {}", entity, e);
throwValidationErrorApi(messages -> messages.addErrorsCrudFailedToUpdateCrudTable(GLOBAL, buildThrowableMessage(e)));
}
return entity;

View file

@ -70,7 +70,7 @@ public class ProfileAction extends FessSearchAction {
userService.changePassword(username, form.newPassword);
saveInfo(messages -> messages.addSuccessChangedPassword(GLOBAL));
} catch (final Exception e) {
logger.error("Failed to change password for " + username, e);
logger.error("Failed to change password for {}", username, e);
throwValidationError(messages -> messages.addErrorsFailedToChangePassword(GLOBAL), toIndexPage);
}
return redirect(getClass());

View file

@ -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;

View file

@ -154,7 +154,7 @@ public abstract class AbstractFessFileTransformer extends AbstractTransformer im
if (dt != null) {
dataMap.put(mapping.getValue1(), FessFunctions.formatDate(dt));
} else {
logger.warn("Failed to parse " + mapping.toString());
logger.warn("Failed to parse {}", mapping.toString());
}
} else {
logger.warn("Unknown mapping type: {}={}", key, mapping);

View file

@ -247,7 +247,7 @@ public class FessXpathTransformer extends XpathTransformer implements FessTransf
}
}
} catch (final TransformerException e) {
logger.warn("Could not parse a value of " + META_NAME_ROBOTS_CONTENT, e);
logger.warn("Could not parse a value of {}", META_NAME_ROBOTS_CONTENT, e);
}
}
@ -593,7 +593,7 @@ public class FessXpathTransformer extends XpathTransformer implements FessTransf
parseTextContent(node, buf);
}
} catch (final Exception e) {
logger.warn("Could not parse a value of " + xpath);
logger.warn("Could not parse a value of {}", xpath);
}
if (buf == null) {
return null;
@ -694,7 +694,7 @@ public class FessXpathTransformer extends XpathTransformer implements FessTransf
buf.append("\n");
}
} catch (final Exception e) {
logger.warn("Could not parse a value of " + xpath, e);
logger.warn("Could not parse a value of {}", xpath, e);
}
return buf.toString().trim();
}
@ -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;
@ -865,7 +865,7 @@ public class FessXpathTransformer extends XpathTransformer implements FessTransf
return firstThumbnailUrl;
}
} catch (final Exception e) {
logger.warn("Failed to retrieve thumbnail url from " + responseData.getUrl(), e);
logger.warn("Failed to retrieve thumbnail url from {}", responseData.getUrl(), e);
}
return null;
}

View file

@ -71,7 +71,7 @@ public class DictionaryManager {
}
}
} catch (final Exception e) {
logger.warn("Failed to load " + fileMap, e);
logger.warn("Failed to load {}", fileMap, e);
}
return null;
}).filter(file -> file != null).toArray(n -> new DictionaryFile<?>[n]);

View file

@ -152,7 +152,7 @@ public class CharMappingFile extends DictionaryFile<CharMappingItem> {
final Matcher m = parsePattern.matcher(replacedLine);
if (!m.find()) {
logger.warn("Failed to parse " + line + " in " + path);
logger.warn("Failed to parse {} in {}", line, path);
if (updater != null) {
updater.write("# " + line);
}
@ -163,7 +163,7 @@ public class CharMappingFile extends DictionaryFile<CharMappingItem> {
output = m.group(2).trim();
if (inputs == null || output == null || inputs.length == 0) {
logger.warn("Failed to parse " + line + " in " + path);
logger.warn("Failed to parse {} in {}", line, path);
if (updater != null) {
updater.write("# " + line);
}

View file

@ -149,7 +149,7 @@ public class StemmerOverrideFile extends DictionaryFile<StemmerOverrideItem> {
final Matcher m = parsePattern.matcher(replacedLine);
if (!m.find()) {
logger.warn("Failed to parse " + line + " in " + path);
logger.warn("Failed to parse {} in {}", line, path);
if (updater != null) {
updater.write("# " + line);
}
@ -160,7 +160,7 @@ public class StemmerOverrideFile extends DictionaryFile<StemmerOverrideItem> {
final String output = m.group(2).trim();
if (input == null || output == null) {
logger.warn("Failed to parse " + line + " in " + path);
logger.warn("Failed to parse {} in {}", line, path);
if (updater != null) {
updater.write("# " + line);
}

View file

@ -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);
@ -107,7 +107,7 @@ public class DataStoreFactory {
}
}
} catch (final Exception e) {
logger.warn("Failed to load " + jarFile.getAbsolutePath(), e);
logger.warn("Failed to load {}", jarFile.getAbsolutePath(), e);
}
}
return nameSet.stream().sorted().collect(Collectors.toList());

View file

@ -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();
}

View file

@ -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
@ -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());
}
}

View file

@ -352,10 +352,10 @@ public class FessEsClient implements Client {
if (response.getHttpStatusCode() == 200) {
return true;
} else {
logger.warn("Failed to reindex from " + fromIndex + " to " + toIndex);
logger.warn("Failed to reindex from {} to {}", fromIndex, toIndex);
}
} catch (final IOException e) {
logger.warn("Failed to reindex from " + fromIndex + " to " + toIndex, e);
logger.warn("Failed to reindex from {} to {}", fromIndex, toIndex, e);
}
return false;
}
@ -389,10 +389,10 @@ public class FessEsClient implements Client {
client.admin().indices().prepareCreate(indexName).setSource(source, XContentType.JSON).execute()
.actionGet(fessConfig.getIndexIndicesTimeout());
if (indexResponse.isAcknowledged()) {
logger.info("Created " + indexName + " index.");
logger.info("Created {} index.", indexName);
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);
@ -430,7 +430,7 @@ public class FessEsClient implements Client {
insertBulkData(fessConfig, indexName, docType, dataPath);
}
} catch (final Exception e) {
logger.warn("Failed to create " + indexName + "/" + docType + " mapping.", e);
logger.warn("Failed to create {}/{} mapping.", indexName, docType, e);
}
} else if (logger.isDebugEnabled()) {
logger.debug(indexName + "/" + docType + " mapping exists.");
@ -478,9 +478,9 @@ public class FessEsClient implements Client {
client.admin().indices().prepareAliases().addAlias(createdIndexName, aliasName, source).execute()
.actionGet(fessConfig.getIndexIndicesTimeout());
if (response.isAcknowledged()) {
logger.info("Created " + aliasName + " alias for " + createdIndexName);
logger.info("Created {} alias for {}", aliasName, createdIndexName);
} else if (logger.isDebugEnabled()) {
logger.debug("Failed to create " + aliasName + " alias for " + createdIndexName);
logger.debug("Failed to create {} alias for {}", aliasName, createdIndexName);
}
}));
}
@ -501,17 +501,17 @@ public class FessEsClient implements Client {
try (CurlResponse response =
ComponentUtil.getCurlHelper().post("/_configsync/file").param("path", path).body(source).execute()) {
if (response.getHttpStatusCode() == 200) {
logger.info("Register " + path + " to " + index);
logger.info("Register {} to {}", path, index);
} else {
if (response.getContentException() != null) {
logger.warn("Invalid request for " + path + ".", response.getContentException());
logger.warn("Invalid request for {}.", path, response.getContentException());
} else {
logger.warn("Invalid request for " + path + ". The response is " + response.getContentAsString());
logger.warn("Invalid request for {}. The response is {}", path, response.getContentAsString());
}
}
}
} catch (final Exception e) {
logger.warn("Failed to register " + filePath, e);
logger.warn("Failed to register {}", filePath, e);
}
});
try (CurlResponse response = ComponentUtil.getCurlHelper().post("/_configsync/flush").execute()) {
@ -559,7 +559,7 @@ public class FessEsClient implements Client {
}
}
} catch (final Exception e) {
logger.warn("Failed to parse " + dataPath);
logger.warn("Failed to parse {}", dataPath);
}
return StringUtil.EMPTY;
});

View file

@ -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 {
@ -61,7 +61,7 @@ public class ScheduledJobBhv extends BsScheduledJobBhv {
}
}
}
logger.warn("Failed to select a job by " + id, lastException);
logger.warn("Failed to select a job by {}", id, lastException);
return OptionalEntity.empty();
}
}

View file

@ -234,7 +234,7 @@ public class DataConfig extends BsDataConfig implements CrawlingConfig {
try {
smbAuth.setPort(Integer.parseInt(port));
} catch (final NumberFormatException e) {
logger.warn("Failed to parse " + port, e);
logger.warn("Failed to parse {}", port, e);
}
}
smbAuth.setUsername(username);
@ -249,7 +249,7 @@ public class DataConfig extends BsDataConfig implements CrawlingConfig {
try {
smb1Auth.setPort(Integer.parseInt(port));
} catch (final NumberFormatException e) {
logger.warn("Failed to parse " + port, e);
logger.warn("Failed to parse {}", port, e);
}
}
smb1Auth.setUsername(username);
@ -272,7 +272,7 @@ public class DataConfig extends BsDataConfig implements CrawlingConfig {
try {
ftpAuth.setPort(Integer.parseInt(port));
} catch (final NumberFormatException e) {
logger.warn("Failed to parse " + port, e);
logger.warn("Failed to parse {}", port, e);
}
}
ftpAuth.setUsername(username);
@ -350,7 +350,7 @@ public class DataConfig extends BsDataConfig implements CrawlingConfig {
try {
p = Integer.parseInt(port);
} catch (final NumberFormatException e) {
logger.warn("Failed to parse " + port, e);
logger.warn("Failed to parse {}", port, e);
}
}

View file

@ -54,7 +54,7 @@ public class FileAuthentication extends BsFileAuthentication {
try {
fileConfig = fileConfigService.getFileConfig(getFileConfigId()).get();
} catch (final Exception e) {
logger.warn("File Config " + getFileConfigId() + " does not exist.", e);
logger.warn("File Config {} does not exist.", getFileConfigId(), e);
}
}
return fileConfig;

View file

@ -69,7 +69,7 @@ public class PathMapping extends BsPathMapping {
try {
return pathMapper.apply(input, matcher);
} catch (final Exception e) {
logger.warn("Failed to apply " + pathMapper, e);
logger.warn("Failed to apply {}", pathMapper, e);
}
}
return input;

View file

@ -58,7 +58,7 @@ public class RequestHeader extends BsRequestHeader {
try {
webConfig = webConfigService.getWebConfig(getWebConfigId()).get();
} catch (final Exception e) {
logger.warn("Web Config " + getWebConfigId() + " does not exist.", e);
logger.warn("Web Config {} does not exist.", getWebConfigId(), e);
}
}
return webConfig;

View file

@ -124,7 +124,7 @@ public class WebAuthentication extends BsWebAuthentication {
try {
webConfig = webConfigService.getWebConfig(getWebConfigId()).get();
} catch (final Exception e) {
logger.warn("Web Config " + getWebConfigId() + " does not exist.", e);
logger.warn("Web Config {} does not exist.", getWebConfigId(), e);
}
}
return webConfig;

View file

@ -141,7 +141,7 @@ public class ThumbnailGenerator {
final int totalCount = process(options);
if (totalCount != 0) {
logger.info("Created " + totalCount + " thumbnail files.");
logger.info("Created {} thumbnail files.", totalCount);
} else {
logger.info("No new thumbnails found.");
}

View file

@ -221,7 +221,7 @@ public class DataIndexHelper {
final DataStoreFactory dataStoreFactory = ComponentUtil.getDataStoreFactory();
dataStore = dataStoreFactory.getDataStore(dataConfig.getHandlerName());
if (dataStore == null) {
logger.error("DataStore(" + dataConfig.getHandlerName() + ") is not found.");
logger.error("DataStore({}) is not found.", dataConfig.getHandlerName());
} else {
try {
dataStore.store(dataConfig, indexUpdateCallback, initParamMap);
@ -242,7 +242,7 @@ public class DataIndexHelper {
}
final String sessionId = initParamMap.get(Constants.SESSION_ID);
if (StringUtil.isBlank(sessionId)) {
logger.warn("Invalid sessionId at " + dataConfig);
logger.warn("Invalid sessionId at {}", dataConfig);
return;
}
final FessConfig fessConfig = ComponentUtil.getFessConfig();
@ -260,7 +260,7 @@ public class DataIndexHelper {
final long numOfDeleted = fessEsClient.deleteByQuery(index, queryBuilder);
logger.info("Deleted {} old docs.", numOfDeleted);
} catch (final Exception e) {
logger.error("Could not delete old docs at " + dataConfig, e);
logger.error("Could not delete old docs at {}", dataConfig, e);
}
}

View file

@ -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);
}
}
}
@ -249,7 +249,7 @@ public class DocumentHelper {
}
return SIMILAR_DOC_HASH_PREFIX + Base64.getUrlEncoder().withoutPadding().encodeToString(baos.toByteArray());
} catch (final IOException e) {
logger.warn("Failed to encode " + hash, e);
logger.warn("Failed to encode {}", hash, e);
}
}
return hash;

View file

@ -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()) {

View file

@ -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;
@ -73,7 +73,7 @@ public class JobHelper {
final Map<String, Object> params = new HashMap<>();
ComponentUtil.getComponent(ScheduledJobBhv.class).selectByPK(scheduledJob.getId())
.ifPresent(e -> params.put(Constants.SCHEDULED_JOB, e)).orElse(() -> {
logger.warn("Job " + scheduledJob.getId() + " is not found.");
logger.warn("Job {} is not found.", scheduledJob.getId());
});
return params;
};
@ -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);

View file

@ -258,7 +258,7 @@ 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;
}
@ -271,7 +271,7 @@ public class LabelTypeHelper {
} 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;
}

View file

@ -144,7 +144,7 @@ public class PluginHelper {
}
}
} catch (final Exception e) {
logger.warn("Failed to parse " + pluginUrl + "maven-metadata.xml.", e);
logger.warn("Failed to parse {}maven-metadata.xml.", pluginUrl, e);
}
}
return list;
@ -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();

View file

@ -47,11 +47,11 @@ public class ProcessHelper {
public void destroy() {
for (final String sessionId : runningProcessMap.keySet()) {
if (logger.isInfoEnabled()) {
logger.info("Stopping process " + sessionId);
logger.info("Stopping process {}", sessionId);
}
if (destroyProcess(sessionId) == 0) {
if (logger.isInfoEnabled()) {
logger.info("Stopped process " + sessionId);
logger.info("Stopped process {}", sessionId);
}
}
}

View file

@ -110,7 +110,7 @@ public class SuggestHelper {
try {
suggester.settings().array().add(SuggestSettings.DefaultKeys.SUPPORTED_FIELDS, field);
} catch (final SuggestSettingsException e) {
logger.warn("Failed to add " + field, e);
logger.warn("Failed to add {}", field, e);
}
}));
suggester.createIndexIfNothing();

View file

@ -112,17 +112,17 @@ 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);
} catch (final IOException e) {
logger.warn("Failed to delete " + f, e);
logger.warn("Failed to delete {}", f, e);
}
});
Files.deleteIfExists(dir);
} catch (final IOException e) {
logger.warn("Failed to delete " + dir, e);
logger.warn("Failed to delete {}", dir, e);
}
}

View file

@ -360,7 +360,7 @@ public class ViewHelper {
url = URLDecoder.decode(url.replace("+", "%2B"), urlLinkEncoding);
} catch (final Exception e) {
if (logger.isDebugEnabled()) {
logger.warn("Failed to decode " + url, e);
logger.warn("Failed to decode {}", url, e);
}
}
}
@ -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;

View file

@ -143,7 +143,7 @@ public class WebFsIndexHelper {
try {
urlFilterService.delete(sid);
} catch (final Exception e) {
logger.warn("Failed to delete url filters for " + sid);
logger.warn("Failed to delete url filters for {}", sid);
}
}
@ -195,7 +195,7 @@ public class WebFsIndexHelper {
}
if (logger.isDebugEnabled()) {
logger.debug("Crawling " + urlsStr);
logger.debug("Crawling {}", urlsStr);
}
crawler.setBackground(true);
@ -251,7 +251,7 @@ public class WebFsIndexHelper {
try {
urlFilterService.delete(sid);
} catch (final Exception e) {
logger.warn("Failed to delete url filters for " + sid);
logger.warn("Failed to delete url filters for {}", sid);
}
}
@ -330,7 +330,7 @@ public class WebFsIndexHelper {
}
if (logger.isDebugEnabled()) {
logger.debug("Crawling " + pathsStr);
logger.debug("Crawling {}", pathsStr);
}
crawler.setBackground(true);
@ -465,7 +465,7 @@ public class WebFsIndexHelper {
// clear url filter
urlFilterService.delete(sid);
} catch (final Exception e) {
logger.warn("Failed to delete UrlFilter for " + sid, e);
logger.warn("Failed to delete UrlFilter for {}", sid, e);
}
try {
@ -473,14 +473,14 @@ public class WebFsIndexHelper {
urlQueueService.clearCache();
urlQueueService.delete(sid);
} catch (final Exception e) {
logger.warn("Failed to delete UrlQueue for " + sid, e);
logger.warn("Failed to delete UrlQueue for {}", sid, e);
}
try {
// clear
dataService.delete(sid);
} catch (final Exception e) {
logger.warn("Failed to delete AccessResult for " + sid, e);
logger.warn("Failed to delete AccessResult for {}", sid, e);
}
}

View file

@ -252,7 +252,7 @@ public class IndexUpdater extends Thread {
throw e;
}
errorCount++;
logger.warn("Failed to access data. Retry to access.. " + errorCount, e);
logger.warn("Failed to access data. Retry to access.. {}", errorCount, e);
} finally {
if (systemHelper.isForceStop()) {
finishCrawling = 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;
}
@ -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);
}
}
@ -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;
}

View file

@ -63,7 +63,7 @@ public class UpdateLabelJob {
.field(fessConfig.getIndexFieldLabel(), labelSet.toArray(n -> new String[n])).endObject());
}
} catch (final IOException e) {
logger.warn("Failed to process " + hit, e);
logger.warn("Failed to process {}", hit, e);
}
return null;
});

View file

@ -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();

View file

@ -135,7 +135,7 @@ public class SpnegoAuthenticator implements SsoAuthenticator {
}
if (logger.isDebugEnabled()) {
logger.debug("principal=" + principal);
logger.debug("principal={}", principal);
}
final String[] username = principal.getName().split("@", 2);

View file

@ -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());

View file

@ -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);
@ -243,7 +243,7 @@ public class ThumbnailManager {
final File noImageFile = new File(outputFile.getAbsolutePath() + NOIMAGE_FILE_SUFFIX);
if (!noImageFile.isFile() || System.currentTimeMillis() - noImageFile.lastModified() > noImageExpired) {
if (noImageFile.isFile() && !noImageFile.delete()) {
logger.warn("Failed to delete " + noImageFile.getAbsolutePath());
logger.warn("Failed to delete {}", noImageFile.getAbsolutePath());
}
final ThumbnailGenerator generator = ComponentUtil.getComponent(generatorName);
if (generator.isAvailable()) {
@ -262,7 +262,7 @@ public class ThumbnailManager {
logger.debug("No image file exists: " + noImageFile.getAbsolutePath());
}
} catch (final Exception e) {
logger.warn("Failed to create thumbnail for " + entity, e);
logger.warn("Failed to create thumbnail for {}", entity, e);
}
}
@ -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();
@ -415,7 +415,7 @@ public class ThumbnailManager {
parent = parent.getParent();
}
} catch (final IOException e) {
logger.warn("Failed to delete " + path, e);
logger.warn("Failed to delete {}", path, e);
}
}
@ -455,7 +455,7 @@ public class ThumbnailManager {
@Override
public FileVisitResult visitFileFailed(final Path file, final IOException e) throws IOException {
if (e != null) {
logger.warn("I/O exception on " + file, e);
logger.warn("I/O exception on {}", file, e);
}
return FileVisitResult.CONTINUE;
}
@ -463,7 +463,7 @@ public class ThumbnailManager {
@Override
public FileVisitResult postVisitDirectory(final Path dir, final IOException e) throws IOException {
if (e != null) {
logger.warn("I/O exception on " + dir, e);
logger.warn("I/O exception on {}", dir, e);
}
deleteEmptyDirectory(dir);
return FileVisitResult.CONTINUE;
@ -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;
}
@ -504,9 +504,9 @@ public class ThumbnailManager {
// ignore
}
Files.move(path, newPath);
logger.info("Move " + path + " to " + newPath);
logger.info("Move {} to {}", path, newPath);
} catch (final IOException e) {
logger.warn("Failed to move " + path, e);
logger.warn("Failed to move {}", path, e);
}
}
} );

View file

@ -154,7 +154,7 @@ public abstract class BaseThumbnailGenerator implements ThumbnailGenerator {
ComponentUtil.getIndexingHelper().updateDocument(ComponentUtil.getFessEsClient(), thumbnailId,
fessConfig.getIndexFieldThumbnail(), value);
} catch (final Exception e) {
logger.warn("Failed to update thumbnail field at " + thumbnailId, e);
logger.warn("Failed to update thumbnail field at {}", thumbnailId, e);
}
}
@ -182,10 +182,10 @@ public abstract class BaseThumbnailGenerator implements ThumbnailGenerator {
if (e.getCause() == null) {
logger.debug(e.getMessage());
} else {
logger.warn("Failed to process " + id, e);
logger.warn("Failed to process {}", id, e);
}
} catch (final Exception e) {
logger.warn("Failed to process " + id, e);
logger.warn("Failed to process {}", id, e);
}
return false;
}

View file

@ -101,7 +101,7 @@ public class CommandGenerator extends BaseThumbnailGenerator {
executeCommand(thumbnailId, cmdList);
if (outputFile.isFile() && outputFile.length() == 0) {
logger.warn("Thumbnail File is empty. ID is " + thumbnailId);
logger.warn("Thumbnail File is empty. ID is {}", thumbnailId);
if (outputFile.delete()) {
logger.info("Deleted: " + outputFile.getAbsolutePath());
}
@ -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());
}
}
});
@ -164,7 +164,7 @@ public class CommandGenerator extends BaseThumbnailGenerator {
p.destroy();
}
} catch (final Exception e) {
logger.warn("Failed to generate a thumbnail of " + thumbnailId, e);
logger.warn("Failed to generate a thumbnail of {}", thumbnailId, e);
}
if (task != null) {
task.cancel();

View file

@ -120,7 +120,7 @@ public class HtmlTagBasedGenerator extends BaseThumbnailGenerator {
if (!created) {
updateThumbnailField(thumbnailId, StringUtil.EMPTY);
if (outputFile.exists() && !outputFile.delete()) {
logger.warn("Failed to delete " + outputFile.getAbsolutePath());
logger.warn("Failed to delete {}", outputFile.getAbsolutePath());
}
}
}

View file

@ -48,7 +48,7 @@ public final class GroovyUtil {
// try {
// GroovySystem.getMetaClassRegistry().removeMetaClass(c);
// } catch (Throwable t) {
// logger.warn("Failed to delete " + c, t);
// logger.warn("Failed to delete {}", c, t);
// }
// });
loader.clearCache();

View file

@ -58,7 +58,7 @@ public class ThreadDumpUtil {
}
});
} catch (final Exception e) {
logger.warn("Failed to write a thread dump to " + file, e);
logger.warn("Failed to write a thread dump to {}", file, e);
}
}

View file

@ -50,14 +50,14 @@ public final class UpgradeUtil {
final String source = FileUtil.readUTF8(filePath);
try (CurlResponse response = ComponentUtil.getCurlHelper().post("/_configsync/file").param("path", path).body(source).execute()) {
if (response.getHttpStatusCode() == 200) {
logger.info("Register " + path + " to " + indexName);
logger.info("Register {} to {}", path, indexName);
return true;
} else {
logger.warn("Invalid request for " + path);
logger.warn("Invalid request for {}", path);
}
}
} catch (final Exception e) {
logger.warn("Failed to register " + filePath, e);
logger.warn("Failed to register {}", filePath, e);
}
return false;
}
@ -74,10 +74,10 @@ public final class UpgradeUtil {
indicesClient.prepareAliases().addAlias(indexName, aliasName, source).execute()
.actionGet(fessConfig.getIndexIndicesTimeout());
if (response.isAcknowledged()) {
logger.info("Created " + aliasName + " alias for " + indexName);
logger.info("Created {} alias for {}", aliasName, 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) {
@ -114,7 +114,7 @@ public final class UpgradeUtil {
}
// TODO bulk
} catch (final Exception e) {
logger.warn("Failed to create " + index + "/" + type + " mapping.", e);
logger.warn("Failed to create {}/{} mapping.", index, type, e);
}
}
return false;
@ -150,12 +150,12 @@ public final class UpgradeUtil {
final PutMappingRequestBuilder builder = indicesClient.preparePutMapping(index).setSource(source, XContentType.JSON);
final AcknowledgedResponse pmResponse = builder.execute().actionGet();
if (!pmResponse.isAcknowledged()) {
logger.warn("Failed to update " + index + " settings.");
logger.warn("Failed to update {} settings.", index);
} else {
return true;
}
} catch (final Exception e) {
logger.warn("Failed to update " + index + " settings.", e);
logger.warn("Failed to update {} settings.", index, e);
}
return false;
@ -167,7 +167,7 @@ public final class UpgradeUtil {
fessEsClient.index(indexRequest).actionGet();
return true;
} catch (final Exception e) {
logger.warn("Failed to add " + id + " to " + index, e);
logger.warn("Failed to add {} to {}", id, index, e);
}
return false;
}
@ -191,13 +191,13 @@ public final class UpgradeUtil {
@Override
public void onResponse(final AcknowledgedResponse response) {
logger.info("Deleted " + index + " index.");
logger.info("Deleted {} index.", index);
comsumer.accept(response);
}
@Override
public void onFailure(final Exception e) {
logger.warn("Failed to delete " + index + " index.", e);
logger.warn("Failed to delete {} index.", index, e);
}
});
}