Skip to content

Commit

Permalink
shanoir-issue#2560: fix logs in createStats method
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrehenri-dauvergne committed Jan 16, 2025
1 parent 97d0d00 commit 80d847b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ private File recreateFile(final String fileName) throws IOException {
@Async
@Transactional
public void createStats(String studyNameInRegExp, String studyNameOutRegExp, String subjectNameInRegExp, String subjectNameOutRegExp, ShanoirEvent event, String params) throws IOException {
LOG.error("createStats");
String tmpDir = System.getProperty(JAVA_IO_TMPDIR);
File userDir = DatasetFileUtils.getUserImportDir(tmpDir);
File zipFile = recreateFile(userDir + File.separator + "shanoirExportStatistics_" + event.getId() + ZIP);
Expand Down Expand Up @@ -82,6 +83,7 @@ public void createStats(String studyNameInRegExp, String studyNameOutRegExp, Str
String line = Arrays.stream(row)
.map(obj -> Objects.toString(obj, ""))
.collect(Collectors.joining("\t"));
LOG.error("line : " + line);
writer.write(line + "\n");
} catch (Exception e) {
event.setStatus(ShanoirEvent.ERROR);
Expand All @@ -93,6 +95,7 @@ public void createStats(String studyNameInRegExp, String studyNameOutRegExp, Str
});
writer.flush();
zos.closeEntry();
LOG.error("end writing stats");
} finally {
event.setObjectId(String.valueOf(event.getId()));
event.setProgress(1f);
Expand Down
4 changes: 0 additions & 4 deletions shanoir-ng-datasets/src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ along with this program. If not, see https://www.gnu.org/licenses/gpl-3.0.html
<appender-ref ref="EVENT_FILE_LOG" />
</logger>

<logger name="org.shanoir.ng.dataset.service.CreateStatisticsService" level="INFO" additivity="false">
<appender-ref ref="FILE" />
</logger>

<logger name="org.shanoir.ng.dicom.DIMSEService" level="INFO" additivity="false">
<appender-ref ref="DIMSE_FILE_LOG" />
</logger>
Expand Down

0 comments on commit 80d847b

Please sign in to comment.