Forums / General / Sitewide Audit Trail

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

eZ debug

Timing: Jan 18 2025 16:21:04
Script start
Timing: Jan 18 2025 16:21:04
Module start 'content'
Timing: Jan 18 2025 16:21:05
Module end 'content'
Timing: Jan 18 2025 16:21:05
Script end

Main resources:

Total runtime0.8884 sec
Peak memory usage4,096.0000 KB
Database Queries197

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0062 587.6016180.8516
Module start 'content' 0.00620.7535 768.4531561.1328
Module end 'content' 0.75980.1286 1,329.5859336.7656
Script end 0.8883  1,666.3516 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00380.4299210.0002
Check MTime0.00140.1598210.0001
Mysql Total
Database connection0.00080.085810.0008
Mysqli_queries0.822592.58591970.0042
Looping result0.00180.20751950.0000
Template Total0.861697.020.4308
Template load0.00220.250120.0011
Template processing0.859496.733820.4297
Template load and register function0.00020.019310.0002
states
state_id_array0.00090.096610.0009
state_identifier_array0.00090.098820.0004
Override
Cache load0.00180.2079410.0000
Sytem overhead
Fetch class attribute can translate value0.00140.162230.0005
Fetch class attribute name0.00080.094350.0002
XML
Image XML parsing0.00090.098130.0003
class_abstraction
Instantiating content class attribute0.00000.001050.0000
General
dbfile0.00200.2294290.0001
String conversion0.00000.000630.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 21
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs