优化:添加日志

This commit is contained in:
陈精华
2020-05-14 10:11:15 +08:00
committed by kl
parent 9cc0267619
commit 59ac8effc1
9 changed files with 31 additions and 33 deletions

View File

@ -43,7 +43,7 @@ public class CadToPdf {
cadImage.close();
return true;
} catch (FileNotFoundException e) {
logger.error("PDFFileNotFoundException", e);
logger.error("PDFFileNotFoundExceptioninputFilePath{}", inputFilePath, e);
return false;
}
}

View File

@ -33,10 +33,7 @@ public class ConverterUtils {
private final Logger logger = LoggerFactory.getLogger(ConverterUtils.class);
// @Value("${office.home}")
// String officeHome;
// OpenOfficeConnection connection;
OfficeManager officeManager;
private OfficeManager officeManager;
@PostConstruct
public void initOfficeManager() {

View File

@ -84,7 +84,7 @@ public class DownloadUtils {
}
return response;
} catch (IOException e) {
LOGGER.error("文件下载失败", e);
LOGGER.error("文件下载失败url{}", urlAddress, e);
response.setCode(1);
response.setContent(null);
if (e instanceof FileNotFoundException) {

View File

@ -36,7 +36,7 @@ public class FileUtils {
String fileDir = ConfigConstants.getFileDir();
/**
* 已转换过的文件集合(redis缓存)
* 已转换过的文件集合(缓存)
* @return
*/
public Map<String, String> listConvertedFiles() {

View File

@ -18,7 +18,7 @@ import java.util.List;
@Component
public class PdfUtils {
private final Logger LOGGER = LoggerFactory.getLogger(PdfUtils.class);
private final Logger logger = LoggerFactory.getLogger(PdfUtils.class);
@Autowired
FileUtils fileUtils;
@ -57,7 +57,7 @@ public class PdfUtils {
doc.close();
fileUtils.addConvertedPdfImage(pdfFilePath, pageCount);
} catch (IOException e) {
LOGGER.error("Convert pdf to jpg exception", e);
logger.error("Convert pdf to jpg exception, pdfFilePath{}", pdfFilePath, e);
}
return imageUrls;
}

View File

@ -17,7 +17,7 @@ import org.springframework.stereotype.Component;
@ConditionalOnExpression("'${cache.clean.enabled:false}'.equals('true')")
public class ShedulerClean {
private static final Logger LOGGER = LoggerFactory.getLogger(ShedulerClean.class);
private final Logger logger = LoggerFactory.getLogger(ShedulerClean.class);
@Autowired
private CacheService cacheService;
@ -27,9 +27,9 @@ public class ShedulerClean {
//默认每晚3点执行一次
@Scheduled(cron = "${cache.clean.cron:0 0 3 * * ?}")
public void clean() {
LOGGER.info("Cache clean start");
logger.info("Cache clean start");
cacheService.cleanCache();
DeleteFileUtil.deleteDirectory(fileDir);
LOGGER.info("Cache clean end");
logger.info("Cache clean end");
}
}

View File

@ -427,7 +427,6 @@ public class ZipReader {
@Override
public void run() {
System.out.println("解析压缩文件开始《《《《《《《《《《《《《《《《《《《《《《《");
for (Map<String, ZipArchiveEntry> entryMap : entriesToBeExtracted) {
String childName = entryMap.keySet().iterator().next();
ZipArchiveEntry entry = entryMap.values().iterator().next();
@ -445,7 +444,6 @@ public class ZipReader {
if (new File(filePath).exists()) {
new File(filePath).delete();
}
System.out.println("解析压缩文件结束《《《《《《《《《《《《《《《《《《《《《《《");
}