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.
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.
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
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.
That is indeed what I did, and it works nicely. Cheers Tim.
is working on a reply...