Skip to main content

此版本的 GitHub Enterprise Server 将于以下日期停止服务 2026-03-17. 即使针对重大安全问题,也不会发布补丁。 为了获得更好的性能、更高的安全性和新功能,请升级到最新版本的 GitHub Enterprise。 如需升级帮助,请联系 GitHub Enterprise 支持

为企业配置审核日志

可以为企业的审核日志配置设置。

谁可以使用此功能?

Enterprise owners can configure the audit log.

About audit log configuration

You can configure a retention period for audit log data and see index storage details.

After you configure a retention period, you can enable or disable Git-related events from appearing in the audit log.

Configuring a retention period for audit log data

You can configure a retention period for audit log data for your GitHub Enterprise Server instance. Data that exceeds the period you configure will be permanently removed from disk.

  1. In the top-right corner of GitHub Enterprise Server, click your profile picture, then click Enterprise settings.
  2. On the left side of the page, in the enterprise account sidebar, click Settings.
  3. Under "Settings", click Audit log.
  4. Under "Audit log", click Audit Data Retention.
  5. Under "Configure audit log retention settings", select the dropdown menu and click a retention period.
  6. Click Save.

Managing Git events in the audit log

You can enable or disable Git-related events, such as git.clone and git.push, from appearing in your audit log. For a list of the Git events are logged, see Audit log events for your enterprise.

If you do enable Git events, due to the large number of Git events that are logged, we recommend monitoring your instance's file storage and reviewing your related alert configurations. For more information, see Recommended alert thresholds.

Before you can enable Git events in the audit log, you must configure a retention period for audit log data other than "infinite." For more information, see Configuring a retention period for audit log data.

注意

Git events are not included in search results.

  1. In the top-right corner of GitHub Enterprise Server, click your profile picture, then click Enterprise settings.

  2. On the left side of the page, in the enterprise account sidebar, click Settings.

  3. Under "Settings", click Audit log.

  4. Under "Audit log", click Audit Data Retention.

  5. Under "Git event opt-in", select or deselect Enable git events in the audit-log.

    注意

    The retention policy must be set to something other than infinite for this option to display.

    Screenshot of the audit log. The checkbox to enable Git events in the audit log is highlighted with an orange outline.

  6. Click Save.