Skip to content

Commit

Permalink
Fix harvester execution logs added to previous logs
Browse files Browse the repository at this point in the history
  • Loading branch information
josegar74 authored and github-actions[bot] committed Sep 26, 2024
1 parent e17d756 commit 4153e44
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/src/main/java/org/fao/geonet/util/LogUtil.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2001-2023 Food and Agriculture Organization of the
* Copyright (C) 2001-2024 Food and Agriculture Organization of the
* United Nations (FAO-UN), United Nations World Food Programme (WFP)
* and United Nations Environment Programme (UNEP)
*
Expand Down Expand Up @@ -57,7 +57,7 @@ public static String initializeHarvesterLog(String type, String name) {
// Filename safe representation of harvester name (using '_' as needed).
final String harvesterName = name.replaceAll("\\W+", "_");
final String harvesterType = type.replaceAll("\\W+", "_");
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmm");
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");

String logfile = "harvester_"
+ harvesterType
Expand All @@ -71,7 +71,7 @@ public static String initializeHarvesterLog(String type, String name) {
}

ThreadContext.put("harvest", harvesterName);
ThreadContext.putIfNull("logfile", logfile);
ThreadContext.put("logfile", logfile);
ThreadContext.put("timeZone", timeZoneSetting);

return logfile;
Expand Down

0 comments on commit 4153e44

Please sign in to comment.