Diplo Audit Log Viewer for Umbraco 8 Blog post

A Little History

Way back in 2016 I created a package for Umbraco 7 that allowed you to view the contents of the umbracoLog table. You can find more about that in the blog post I wrote at the time. With the release of Umbraco 8 earlier this year (2019) I decided it was time to start looking at moving some of my packages over to v8 and decided this package would be a good choice. However, I hadn't reckoned on just how much in v8 had changed - especially in terms of working with the more low-level aspects of Umbraco, such as using the back-office services and interacting with databases. So what started out as a simple port became a wholesale rewrite! If you are a developer, I'm sure you are familiar with this!

So What Does It Do?

Basically if you install the package you will get two new trees in the Settings section of Umbraco within the Third Party area, like this:

Audit Tree in Settings

The Content Audit Logs tree allows you to view, filter, search and paginate through all the umbracoLog table entries. This is the log of all changes to content that is made in Umbraco.

You can filter by:

  • The type of content change eg. Save, Publish, Delete etc.
  • The user who performed the change
  • The content node that was changed (using a handy page picker)
  • Date range
  • You can also perform a free-text search of the log contents

Where a change affected a content node then the Id of the node is shown along with it's content type (eg. Document, Media, Member) and clicking the Id of the node will take you directly to edit the content. This works for content, members, media, document types, data types etc.

The Audit Trail Logs tree allows you to view, filter, search and paginate through all the umbracoAudit table entries. This is the log of all audit events, such as log-ins, changes of password or where a User changes the actual document types or member types etc.

You can filter by:

  • The type of event eg. umbraco/user/sign-in/login
  • The user who performed the action
  • The user who the action was performed upon (if relevant)
  • Date range
  • You can also perform a free-text search of the log contents

For both logs you can order the data by the relevant column by clicking it (clicking it again reverses the order). You can also step through the entries via the pagination controls.

Screenshots

As Leonardo da Vinci once said, "A screenshot is worth a thousand pizzas"...

Content Log Viewer

Content Log

Filtering By User and Searching

Content Log Filtering

Audit Log Viewer

Content Log

Filtering Audit Log by Date

Audit Log Filtering by Date

What's New for v8

So without going into loads of technical detail, I decided to rewrite most of the code so:

  • I used dependency injection to register my services (using Composing) so they could be injected in the API controllers
  • I used interfaces for the services (so in theory you can swap them out for your own implementation if you really want!)
  • I rewrote the database access code to work with Umbraco 8's implementation of NPoco - this has changed a lot from v7 and isn't documented anywhere!
  • I rewrote most of the AngularJS code in line with the way Umbraco recommend
  • I restyled the views to match Umbraco 8 styling
  • I added a brand new viewer that allows you to look at the new(ish) umbracoAudit table that was added at some point in late v7

How Do You Use It?

You can install it either via NuGet or as a package from Our Umbraco. See full details below.

Viewing Content Logs

  • Click the Content Audit Logs tree heading to view a table of all changes to content.
  • You can then use the filters at the top to filter the data. You can also use the quick filters in the tree to quickly filter by date range or by the top pages to be modified recently.
  • You can order any column by clicking on it's heading. Clicking again reverses the order.
  • If you see an entry with an "eye" symbol next to the Action name you can click the row to view the log comment text.
  • If an entry has a value under the Node column you can click the ID and it will take you to edit the associated content that has been changed - whether this be a page, a document type or media etc.
  • Use the pagination to move between pages of log data.

Viewing Audit Logs

  • Click the Audit Trail Logs tree heading to view a table of all audit trail events.
  • You can then use the filters at the top to filter the data. You can also use the quick filters in the tree to quickly filter by date range.
  • You can order any column by clicking on it's heading. Clicking again reverses the order.
  • Use the pagination to move between pages of log data.

Where Can I Get It?

NuGet: https://www.nuget.org/packages/Diplo.AuditLogViewer/

Packagehttps://our.umbraco.com/packages/developer-tools/diplo-audit-log-viewer/

GitHub: https://github.com/DanDiplo/Umbraco.AuditLogViewer

Note: This is for Umbraco 8 only! If you need a version for Umbraco v7 then please go here instead


1 Comment


Peter Duncanson Avatar

Excellent work Dan. To me this should be in core. It’s such a useful package. Great work.

Just fill in the form and click Submit. But note all comments are moderated, so spare the viagra spam!

Tip: You can use Markdown syntax within comments.

Comments are stored within the website database in line with the privacy policy of the site, which is frankly dull.