Sitewide Audit Trail

Author Message

Felipe Jaramillo

Thursday 09 November 2006 4:14:25 pm

Hello all,

We need to set up a page that shows a sitewide audit trail. It should contain at least:
Content object id, content object name, user who modified it, date.

I was wondering on what the best way to achieve this. I've read some posts requesting this like: http://ez.no/community/forum/suggestions/audit_trial/re_audit_trial__2
as well as a possible approach here:
http://ez.no/community/forum/general/audit_trail

These were posted three or four years ago.

One approach would be to use a workflow event triggered OnPublish to log the info to a file and then have a custom module view that displays the content of this log.

Any ideas?

Regards,

Felipe

Felipe Jaramillo
eZ Certified Extension Developer
http://www.aplyca.com | Bogotá, Colombia

Łukasz Serwatka

Thursday 09 November 2006 11:11:16 pm

Hi Felipe

Take a look on audit trailing feature of upcoming eZ publish 3.9.

http://pubsvn.ez.no/nextgen/trunk/doc/features/3.9/audit_trailing.txt

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Felipe Jaramillo

Thursday 23 November 2006 11:20:44 am

Thankyou Lukasz,

This looks like a great enhancement, I will look into on a test 3.9 installation.

Unfortunately for this project we are stuck with PHP 4.3 and will need to implement this in eZ 3.6.x.

I have used your eZInformation workflow event (http://ez.no/community/contribs/workflow/information_workflow_event) as a basis for my custom logging event.

I simply added the log class at the top:

include_once( 'lib/ezutils/classes/ezlog.php' );

And just before confirmation a call to eZ log which to /var/log/custom.log

 $owner =&  eZContentObject::fetch( $object->attribute('owner_id') );
        $logNotice = new eZLog();
        $logNotice->write("PUBLISHED: "
                        . $object->attribute('name')
                        . " Owner "
                        . $owner->attribute('name') .
                        " Version: ". $object->attribute('current_version'));

It works great for publishing and editing through the content_publish trigger.

Yet, I see is that the content triggers do not have content_delete or content_move operations, thus limiting the auditing one can do.

Is there any way of executing the event after content deletion without hacking the kernel?

Thanks a lot,

Felpe

 

Felipe Jaramillo
eZ Certified Extension Developer
http://www.aplyca.com | Bogotá, Colombia

Felipe Jaramillo

Thursday 23 November 2006 11:28:48 am

After more thorough searching, I found a few references on this topic:

A hack in the contributions: http://ez.no/community/contribs/hacks/content_remove_workflow

and a forum post on this specific topic:
http://ez.no/community/forum/developer/how_to_making_a_new_delating_trigger

I'll look into this and report.

Regards,

Felipe Jaramillo
eZ Certified Extension Developer
http://www.aplyca.com | Bogotá, Colombia

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 04:26:43
Script start
Timing: Jan 31 2025 04:26:43
Module start 'layout'
Timing: Jan 31 2025 04:26:43
Module start 'content'
Timing: Jan 31 2025 04:26:43
Module end 'content'
Timing: Jan 31 2025 04:26:43
Script end

Main resources:

Total runtime0.0123 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0042 588.0078151.1953
Module start 'layout' 0.00420.0032 739.203136.6328
Module start 'content' 0.00740.0036 775.835994.2188
Module end 'content' 0.01100.0013 870.054733.9922
Script end 0.0123  904.0469 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002217.6615140.0002
Check MTime0.00108.0919140.0001
Mysql Total
Database connection0.00075.353310.0007
Mysqli_queries0.003125.224730.0010
Looping result0.00000.114310.0000
Template Total0.00107.910.0010
Template load0.00086.449510.0008
Template processing0.00021.439010.0002
Override
Cache load0.00064.979510.0006
General
dbfile0.00021.836180.0000
String conversion0.00000.046540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs