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.