From ec382f9d0e85b5fecdc68bd5d268d4a91507d8dc Mon Sep 17 00:00:00 2001 From: Adam Collins Date: Thu, 13 Feb 2025 09:08:34 +1000 Subject: [PATCH] #943 add option to disable download logging --- .../au/org/ala/biocache/service/DownloadService.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/au/org/ala/biocache/service/DownloadService.java b/src/main/java/au/org/ala/biocache/service/DownloadService.java index 09593307f..b9825d1c8 100644 --- a/src/main/java/au/org/ala/biocache/service/DownloadService.java +++ b/src/main/java/au/org/ala/biocache/service/DownloadService.java @@ -249,6 +249,9 @@ public class DownloadService implements ApplicationListener @Value("${download.csdm.email.template:}") protected String biocacheDownloadCSDMEmailTemplate; + @Value("${download.log.enabled:true}") + protected Boolean downloadLogEnabled = true; + ConcurrentHashMap userExecutors; @PostConstruct @@ -577,10 +580,12 @@ public void writeQueryToStream(DownloadDetailsDTO dd, : webservicesRoot + "?" + originalParams; // log the stats to ala logger - LogEventVO vo = new LogEventVO(1002, requestParams.getReasonTypeId(), requestParams.getSourceTypeId(), - requestParams.getEmail(), requestParams.getReason(), dd.getIpAddress(), dd.getUserAgent(), null, downloadStats.getUidStats(), sourceUrl); + if (downloadLogEnabled) { + LogEventVO vo = new LogEventVO(1002, requestParams.getReasonTypeId(), requestParams.getSourceTypeId(), + requestParams.getEmail(), requestParams.getReason(), dd.getIpAddress(), dd.getUserAgent(), null, downloadStats.getUidStats(), sourceUrl); - loggerService.logEvent(vo); + loggerService.logEvent(vo); + } } } catch (RecordWriterException e) { logger.error(e.getMessage(), e);