Skip to content

Commit

Permalink
AuditService: Event Date Time differs in same Audit Message sent to m…
Browse files Browse the repository at this point in the history
…ultiple Audit Record Repositories Fix #1355
  • Loading branch information
gunterze committed Apr 21, 2018
1 parent c6d71c3 commit 324c0d2
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
import java.nio.file.attribute.FileTime;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
Expand Down Expand Up @@ -1745,6 +1746,7 @@ private void writeSpoolFile(AuditServiceUtils.EventType eventType, AuditInfoBuil
LOG.warn("Attempt to write empty file : ", eventType);
return;
}
FileTime eventTime = FileTime.fromMillis(System.currentTimeMillis());
boolean auditAggregate = getArchiveDevice().isAuditAggregate();
AuditLoggerDeviceExtension ext = device.getDeviceExtension(AuditLoggerDeviceExtension.class);
for (AuditLogger auditLogger : ext.getAuditLoggers()) {
Expand All @@ -1757,6 +1759,7 @@ private void writeSpoolFile(AuditServiceUtils.EventType eventType, AuditInfoBuil
StandardOpenOption.APPEND))) {
writer.writeLine(new AuditInfo(auditInfoBuilder), data);
}
Files.setLastModifiedTime(file, eventTime);
if (!auditAggregate)
auditAndProcessFile(auditLogger, file);
} catch (Exception e) {
Expand Down

0 comments on commit 324c0d2

Please sign in to comment.