uAdmin the Golang Web Framework #7 Logs

Abdullah Alrasheed
3 min readNov 12, 2018

--

Your app by default keeps track of many things using the “Log” model. There are many types of logs that app records including:

  • Read: Opened a record
  • Add: Saved a new record
  • Edit: Save an existing record
  • Delete: Deleted a record
  • Login Successful: User login
  • Login Denied: User invalid login
  • Password Reset Request: A password rest was received
  • Password Reset Successful: A password was rest
  • Password Reset Denied: A password reset attempt was rejected
  • Custom: For any other action that you would like to log

Let’s open our app to see how these things work. Open your app and go to “LOGS” model in your dashboard.

You will notice that you have logs for all the actions that you have taken in your app. If you open any of these logs, you will see all the details of that log:

The activity is the main part of your log. This shows you what are the fields of your that you put in your record. It also adds one field for the IP "_IP" the user was using for security.

Edit and Delete logs will allow you to “Undo” them or “Roll Back” your changes.

To test that, I changed one of my todo records from 50 to 60:

Now If I go to “LOGS”, You will find the log of editing this record with the old value Progress: “50”. Click on “Roll Back”:

Now go back to “TODOS” and you will see that your value changed back to 50:

Logs can accumulate so fast and it will get harder to find specific actions when you need to like when conducting an audit and investigating something in your system. Use “Filter” to narrow down what you are looking for:

These records can also be accessed from any record you have in your system. Notice that you have a “History” button when you open any record:

This “History” button will give you logs related to this record:

Congrats, now you know how to understand records you have in your app and how to audit them and revert back actions when you need to.

In Part 8 we will talk about Advanced Security.

--

--