Yii2 Audit records and displays web/cli requests, database changes, php/js errors and associated data.
We (@schmunk42, @eluhr) have taken stewardship of this project. Thank you @Blizzke for adding us to the GitHub maintainer list. Since we are still using this extension extensively, we are focussing on backward-compatibility and improvements.
1.2.x
Existing projects with non-namespace migrations need to include @bedezign/yii2/audit/migrations/1.1.x
in `migrationPath and skip namespaced migrations. (Issue #271)
From PHP 7.2
on Object
became a reserved keyword.
Since enough time went by, we decided to assume everyone is on 7.2 and Yii 2.0.13 by now we won't be keeping
1.0.*
-branch (pre PHP 7.2) up to date anymore.
Please use version 1.1.*
or later.
Tracks minimal data in the base entry:
user_id
- User ID of the visitor (if any), based on Yii::$app->user->id
.ip
- IP Address of the visitor.request_method
- The method used to generate the request, eg: CLI
for console requests and GET
, POST
, DELETE
, PUT
, PATCH
, OPTIONS
or HEAD
for web requests.ajax
- If the page was requested using ajax.route
- The controller and action of the request.duration
- How long the request took to serve.memory_max
- The peak memory usage during the request.created
- The datetime the entry was created.Each panel is optional, and you can even create your own.
RequestPanel
- Tracks all incoming web and console request data:
$_GET
, $_POST
, $_SERVER
, $_FILES
and $_COOKIES
.AssetPanel
- Asset Bundles loaded for the request.ConfigPanel
- Yii and PHP configuration that was used for the request.DbPanel
- SQL queries.ErrorPanel
- Record all PHP exceptions and errors in the background. Once logged you can configure a cron task to email the errors to a developer so issues can be fixed before they are even reported by a user. more infoJavascriptPanel
- Automatically log JavaScript errors. Errors and warning are logged automatically by including JSLoggingAsset
asset bundle. The javascript component also provides methods to manually add logging entries. more infoLogPanel
- Yii logs.MailPanel
- Emails that were sent during the request. more infoProfilingPanel
- Application profiling information.TrailPanel
- Database changes that were made during the request using the AuditTrailBehavior
. more infoExtraDataPanel
- Extra data that you want to store. more infoCurlPanel
- Track your applications cURL requests (including replies, log and headers) more infoYourOwnPanel
- Create your own panel to capture any data you want. more infoGetting started? Try the Installation Guide. You will find further information in the Documentation.
For changes since the last version see the Changelog.
More images are available from the Screenshots page.
Contributions are welcome. Please refer to the contributing guidelines.
Thanks to everyone who has contributed.
BSD-3 - Please refer to the license.
$enablePrettyDiffForTrails
to prettyfied json outputexportAtIntervals
log-target configuration to allow export during the request.So finally a release. It's long overdue, I know. Trust me, there are reasons for my absence, but I'll skip the excuses part and promise to try to do better from now on, even though it's impossible to give any guarantee. There's tons more to do (like getting tests to work again etc), I wanted to get a new release out there first so everyone can go back to a stable version.
This module is now PHP 7.2 and Yii 2 2.0.13+ only.
setEntry
functionHTTP_X_FORWARDED_FOR
as IP when it is setphp-mime-mail-parser
optional (mail panel will now work without, with less functionality). This means you don't need the mailparse
extension anymore to install Audit.object
is reserved as a type hint keyword and thus the Yii Object
class was renamed to BaseObject
. For PHP < 7.2 a workaround was added that still provides an Object
class. This means that Audit v1.0 will work for Yii >= 2.0.13, as long as you do not use PHP >= 7.2AuditTrailSearch.field
should allow array
*
as prefix in route matchinggenerateTrace()
-function to the Helper
for external usageSoapFault
s
Comments