Download the PHP package superbig/craft-audit without Composer

On this page you can find all versions of the php package superbig/craft-audit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package craft-audit

Audit plugin for Craft CMS 5

Enterprise-grade audit logging for Craft CMS. Track every change, login, and system event — then send your logs anywhere.

$99.00 through the Craft Plugin Store for production use.

What It Does

Audit automatically logs actions performed by authenticated users:

No configuration required — install the plugin and logging starts immediately.

Requirements

Installation

Then go to Settings → Plugins in the Control Panel and click Install for Audit.

Screenshots


Configuration

Create a config/audit.php file to customize behavior:

This file supports multi-environment config, so you can have different settings per environment.

Event Categories

Setting What It Logs Default
logElementEvents Entry/asset/user create, save, delete true
logChildElementEvents Child element changes (e.g., Matrix blocks) false
logDraftEvents Draft creation and saves false
logPluginEvents Plugin install, uninstall, enable, disable true
logUserEvents Login, logout true
logRouteEvents Route create, save, delete true
logUserSecurityEvents Account activate, deactivate, suspend, lock true
logPermissionEvents User/group permission changes true
logSchemaEvents Field, section, entry type changes true
logDatabaseEvents Database backup and restore true

Console Commands

Prune Old Logs

Remove log entries older than pruneDays:

Update Geolocation Database

Download the latest MaxMind GeoLite2 database:


Geolocation

Audit can enrich log entries with geographic data using MaxMind GeoLite2 databases.

Setup

  1. Create a free account at MaxMind.com
  2. Generate a license key
  3. Add your credentials to config/audit.php:

  4. Download the database:

Tracked Events

Here's the full list of events Audit captures:

Content Events

Event Constant Description
Entry created EVENT_ENTRY_CREATED New entry saved for the first time
Entry saved EVENT_ENTRY_SAVED Existing entry updated
Entry deleted EVENT_ENTRY_DELETED Entry removed
Element created EVENT_CREATED_ELEMENT Any element (asset, user, etc.) created
Element saved EVENT_SAVED_ELEMENT Any element updated
Element deleted EVENT_DELETED_ELEMENT Any element removed
Global set saved EVENT_SAVED_GLOBAL Global set content updated
Draft created EVENT_CREATED_DRAFT New draft created
Draft saved EVENT_SAVED_DRAFT Draft updated
Draft deleted EVENT_DELETED_DRAFT Draft removed
Elements resaved EVENT_RESAVED_ELEMENTS Bulk resave operation

User Events

Event Constant Description
User logged in USER_LOGGED_IN Successful login
User logged out USER_LOGGED_OUT Logout
User activated EVENT_USER_ACTIVATED Account activated
User deactivated EVENT_USER_DEACTIVATED Account deactivated
User suspended EVENT_USER_SUSPENDED Account suspended
User unsuspended EVENT_USER_UNSUSPENDED Suspension lifted
User locked EVENT_USER_LOCKED Account locked (too many failed logins)
User unlocked EVENT_USER_UNLOCKED Account unlocked
Groups assigned EVENT_USER_GROUPS_ASSIGNED User assigned to groups

Permission Events

Event Constant Description
User permissions saved EVENT_USER_PERMISSIONS_SAVED Individual user permissions changed
Group permissions saved EVENT_GROUP_PERMISSIONS_SAVED Group-level permissions changed
User group created EVENT_USER_GROUP_CREATED New user group
User group saved EVENT_USER_GROUP_SAVED User group updated
User group deleted EVENT_USER_GROUP_DELETED User group removed

Schema Events

Event Constant Description
Field created EVENT_FIELD_CREATED New field added
Field saved EVENT_FIELD_SAVED Field settings updated
Field deleted EVENT_FIELD_DELETED Field removed
Section created EVENT_SECTION_CREATED New section added
Section saved EVENT_SECTION_SAVED Section settings updated
Section deleted EVENT_SECTION_DELETED Section removed
Entry type created EVENT_ENTRY_TYPE_CREATED New entry type added
Entry type saved EVENT_ENTRY_TYPE_SAVED Entry type updated
Entry type deleted EVENT_ENTRY_TYPE_DELETED Entry type removed

System Events

Event Constant Description
Plugin installed EVENT_PLUGIN_INSTALLED Plugin installed
Plugin uninstalled EVENT_PLUGIN_UNINSTALLED Plugin removed
Plugin enabled EVENT_PLUGIN_ENABLED Plugin activated
Plugin disabled EVENT_PLUGIN_DISABLED Plugin deactivated
Route created EVENT_CREATED_ROUTE URL route added
Route saved EVENT_SAVED_ROUTE URL route updated
Route deleted EVENT_DELETED_ROUTE URL route removed
Backup created EVENT_BACKUP_CREATED Database backup made
Backup restored EVENT_BACKUP_RESTORED Database backup restored
System settings changed EVENT_SYSTEM_SETTINGS_CHANGED System config updated
Email settings changed EVENT_EMAIL_SETTINGS_CHANGED Email config updated

Extending Audit

Audit exposes events that let other plugins and modules hook into the logging pipeline. All events follow Craft's standard patterns — CancelableEvent for before hooks, Event for after hooks.

Events Reference

Event Class Cancelable Description
EVENT_DEFINE_SHOULD_LOG AuditService — Early filter — skip logging before model is built
EVENT_BEFORE_LOG AuditService ✓ Modify or cancel an audit entry before save
EVENT_AFTER_LOG AuditService — React after an entry is saved (notifications, sync)
EVENT_SNAPSHOT AuditService — Modify snapshot data attached to an entry
EVENT_REGISTER_EVENT_TYPES AuditService — Register custom event types with labels and categories
EVENT_BEFORE_DRIVER_WRITE DriverManager ✓ Transform or skip data per-driver (e.g., redact PII)
EVENT_AFTER_DRIVER_WRITE DriverManager — Monitor driver health and write performance
EVENT_DEFINE_AUDIT_QUERY AuditService — Modify CP audit log queries
EVENT_BEFORE_PRUNE_LOGS AuditService ✓ Custom retention policies before pruning
EVENT_AFTER_PRUNE_LOGS AuditService — React after logs are pruned

For full event class definitions and advanced usage, see docs/events.md.

Cancel Logging for Specific Conditions

Use EVENT_BEFORE_LOG to cancel or modify entries before they're saved:

Register Custom Event Types

Let your plugin's events show up with proper labels in the Audit CP:

Filter by Element Type

Use EVENT_DEFINE_SHOULD_LOG for cheap, early filtering — before the audit model is even built:

Modifying Snapshots

Use EVENT_SNAPSHOT to add custom data to audit log snapshots:

Permissions

Audit registers two permissions you can assign to user groups:

Permission Handle Description
View audit logs audit-view-logs Access the Audit CP section
Clear old logs audit-clear-logs Prune old log entries

Template Variables

Access audit data in your Twig templates:


Upgrading

From Craft 4 (Audit 2.x/3.x) to Craft 5


Support

Credits

Brought to you by Superbig


All versions of craft-audit with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0.2
craftcms/cms Version ^4.0.0
donatj/phpuseragentparser Version ^1.7.0
geoip2/geoip2 Version ^2.5
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package superbig/craft-audit contains the following files

Loading the files please wait ...