Update logging levels

This commit is contained in:
ViacheslavKlimov 2023-12-01 17:59:56 +02:00
parent 3233d1b97e
commit a97ddcdeca
2 changed files with 7 additions and 2 deletions

View File

@ -67,7 +67,7 @@ public class ImagesUpdater {
defaultDashboard.setTenantId(TenantId.SYS_TENANT_ID);
boolean created = imageService.replaceBase64WithImageUrl(defaultDashboard);
if (created) {
log.info("Created system images for default dashboard '{}'", defaultDashboard.getTitle());
log.debug("Created system images for default dashboard '{}'", defaultDashboard.getTitle());
}
}

View File

@ -24,6 +24,7 @@ import lombok.Data;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
@ -454,7 +455,11 @@ public class BaseImageService extends BaseResourceService implements ImageServic
try {
imageInfo = saveImage(image);
} catch (Exception e) {
log.warn("[{}][{}] Failed to replace Base64 with image url: {}", tenantId, name, StringUtils.abbreviate(data, 50), e);
if (log.isDebugEnabled()) { // printing stacktrace
log.warn("[{}][{}] Failed to replace Base64 with image url for {}", tenantId, name, StringUtils.abbreviate(data, 50), e);
} else {
log.warn("[{}][{}] Failed to replace Base64 with image url for {}: {}", tenantId, name, StringUtils.abbreviate(data, 50), ExceptionUtils.getMessage(e));
}
return UpdateResult.of(false, data);
}
}