mneethiraj commented on code in PR #277:
URL: https://github.com/apache/ranger/pull/277#discussion_r1287675064
##########
agents-audit/src/main/java/org/apache/ranger/audit/utils/AbstractRangerAuditWriter.java:
##########
@@ -262,10 +263,14 @@ public PrintWriter createWriter() throws Exception {
}
if (logWriter == null) {
- // Create the file to write
- logger.info("Creating new log file. auditPath=" + fullPath);
- createFileSystemFolders();
- ostream = fileSystem.create(auditPath);
+ if (reUseLastLogFile){
+ ostream = fileSystem.append(auditPath);
Review Comment:
In case of failure in writing to audit file, the last audit log record may
be incomplete. If subsequent records are appended to this file, all subsequent
records may not be processed by the reader - hence the decision to use a new
file. It will be safe to append only when the last record in the file is a
complete JSON.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]