Skip to content

Commit

Permalink
#943 add option to disable download logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Collins committed Feb 12, 2025
1 parent e7fc967 commit ec382f9
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/main/java/au/org/ala/biocache/service/DownloadService.java
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,9 @@ public class DownloadService implements ApplicationListener<ContextClosedEvent>
@Value("${download.csdm.email.template:}")
protected String biocacheDownloadCSDMEmailTemplate;

@Value("${download.log.enabled:true}")
protected Boolean downloadLogEnabled = true;

ConcurrentHashMap<String, ThreadPoolExecutor> userExecutors;

@PostConstruct
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit ec382f9

Please sign in to comment.