Uploaded image for project: 'Grouper'
  1. Grouper
  2. GRP-548

purge audit logs in loader job

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      similar to loader logs

      int daysToKeepLogs = GrouperLoaderConfig.getPropertyInt(GrouperLoaderConfig.LOADER_RETAIN_DB_LOGS_DAYS, 7);
      if (daysToKeepLogs != -1)

      { //lets get a date Calendar calendar = GregorianCalendar.getInstance(); //get however many days in the past calendar.add(Calendar.DAY_OF_YEAR, -1 * daysToKeepLogs); //run a query to delete (note, dont retrieve records to java, just delete) int records = HibernateSession.bySqlStatic().executeSql("delete from grouper_loader_log where last_updated < ?", (List<Object>)(Object)GrouperUtil.toList(new Timestamp(calendar.getTimeInMillis()))); hib3GrouploaderLog.setJobMessage("Deleted " + records + " records from grouper_loader_log older than " + daysToKeepLogs + " days old"); }

      else

      { hib3GrouploaderLog.setJobMessage("Configured to not delete records from grouper_loader_log table"); }

      hib3GrouploaderLog.setStatus(GrouperLoaderStatus.SUCCESS.name());

        Attachments

          Activity

            People

            Assignee:
            chris.hyzer@at.internet2.edu Chris Hyzer (upenn.edu)
            Reporter:
            chris.hyzer@at.internet2.edu Chris Hyzer (upenn.edu)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:

                Smart Checklist