Skip to content

Commit 397813b

Browse files
authored
Merge pull request #944 from AtlasOfLivingAustralia/943-optionally-disable-download-logging
#943 add option to disable download logging
2 parents d429492 + ec382f9 commit 397813b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/main/java/au/org/ala/biocache/service/DownloadService.java

+8-3
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,9 @@ public class DownloadService implements ApplicationListener<ContextClosedEvent>
249249
@Value("${download.csdm.email.template:}")
250250
protected String biocacheDownloadCSDMEmailTemplate;
251251

252+
@Value("${download.log.enabled:true}")
253+
protected Boolean downloadLogEnabled = true;
254+
252255
ConcurrentHashMap<String, ThreadPoolExecutor> userExecutors;
253256

254257
@PostConstruct
@@ -577,10 +580,12 @@ public void writeQueryToStream(DownloadDetailsDTO dd,
577580
: webservicesRoot + "?" + originalParams;
578581

579582
// log the stats to ala logger
580-
LogEventVO vo = new LogEventVO(1002, requestParams.getReasonTypeId(), requestParams.getSourceTypeId(),
581-
requestParams.getEmail(), requestParams.getReason(), dd.getIpAddress(), dd.getUserAgent(), null, downloadStats.getUidStats(), sourceUrl);
583+
if (downloadLogEnabled) {
584+
LogEventVO vo = new LogEventVO(1002, requestParams.getReasonTypeId(), requestParams.getSourceTypeId(),
585+
requestParams.getEmail(), requestParams.getReason(), dd.getIpAddress(), dd.getUserAgent(), null, downloadStats.getUidStats(), sourceUrl);
582586

583-
loggerService.logEvent(vo);
587+
loggerService.logEvent(vo);
588+
}
584589
}
585590
} catch (RecordWriterException e) {
586591
logger.error(e.getMessage(), e);

0 commit comments

Comments
 (0)