[Product-Developers] Bespoke audit trail

Laurence Rowe l at lrowe.co.uk
Fri Nov 11 22:55:48 UTC 2011


Imran Azad wrote:
> 
> How can I customise Plone so that it can keep an audit trail of which
> pages / folders have been viewed, when they were viewed and by whom?
> 

You can install http://pypi.python.org/pypi/collective.usernamelogger so
that the username is included in the zope access log
(var/log/instance-Z2.log and similar), though it might be quite tricky to
get at this information in a useful way to display in your application.

As you will have relatively few object views (and importantly extremely rare
concurrent views), the simplest way to show some logging might be to add an
additional workflow with a single state and single transition called "view".
You can then call doActionFor directly on the workflow object itself (rather
than with the portal_workflow tool) to avoid any reindexing (as it won't
have changed state, you just want to record the transition.) The transition
will then show up when you click the history link on the page. I think I'd
make the doActionFor call from a viewlet registered for IViewView.

If you need to show views of all the child and descendent content within a
folder then you'll need something more complex.

Laurence

--
View this message in context: http://plone.293351.n2.nabble.com/Bespoke-audit-trail-tp6986914p6986991.html
Sent from the Product Developers mailing list archive at Nabble.com.


More information about the Product-Developers mailing list