Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 4.2.x] Fix harvester execution logs added to previous logs #8388

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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