use of password.pwm.svc.event.AuditService in project pwm by pwm-project.
the class ExportAuditCommand method doCommand.
@Override
void doCommand() throws Exception {
final PwmApplication pwmApplication = cliEnvironment.getPwmApplication();
final AuditService auditManager = new AuditService();
auditManager.init(pwmApplication);
JavaHelper.pause(1000);
final File outputFile = (File) cliEnvironment.getOptions().get(CliParameters.REQUIRED_NEW_OUTPUT_FILE.getName());
final Instant startTime = Instant.now();
out("beginning output to " + outputFile.getAbsolutePath());
final int counter;
try (FileOutputStream fileOutputStream = new FileOutputStream(outputFile, true)) {
counter = auditManager.outputVaultToCsv(fileOutputStream, PwmConstants.DEFAULT_LOCALE, false);
fileOutputStream.close();
}
out("completed writing " + counter + " rows of audit output in " + TimeDuration.fromCurrent(startTime).asLongString());
}
Aggregations