Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Dan 1288 posts 3921 karma points c-trib
    Jun 23, 2011 @ 14:26
    Dan
    0

    Display custom audit trail

    Hi,

    I'm using the audit trail log to record certain events on certain content nodes e.g. if propertyX has changed since last publish, log this change to the umbracoLog table.  This is working fine.  Now I want to display just these custom log messages in a tab in the content area.  I've done this by creating a user control wrapper datatype just to display the log details in the table.

    The question is, what's the best way to actually pull this specific log data out of the umbracoLog table?  Am I best just creating a custom SQL query and binding the results of that, or is there a way to extend the logic out of the 'viewAuditTrail' dialog?  My query on this data needs to be quite custom, something like this:

    SELECT Datestamp, logComment FROM umbracoLog WHERE NodeId = 123 AND logHeader = 'Custom' and logComment LIKE 'Custom log:%'

    I'm thinking probably a custom database query (or SP) is the best way to go, but wanted to check in case someone had any better ideas about modifying the current viewAuditTrail dialog logic.

    Thanks

  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    Jun 28, 2011 @ 19:16
    Tim
    0

    I'd probably just do a custom query, should be nice and fast! If you modify the actual audit dialog, you'd run into problems if you ever upgraded Umbraco, as the changes would be overwritten.

  • Dan 1288 posts 3921 karma points c-trib
    Jun 28, 2011 @ 19:38
    Dan
    0

    That is indeed what I did, and it works nicely.  Cheers Tim.

Please Sign in or register to post replies

Write your reply to:

Draft