Implementing Audit Logging without using security

Hi,

I’m trying to use Audit Logging with Servoy. In Servoy Developer I have checked the Log Server option in one of my Database Servers and the log table was created but nothing is generated into that table.

My solution is not using security. Is not possible to use Audit Logging without loging into Servoy security?

Audit log is activated at the table level: see the ‘Security’ tab of the tables.
You will see that it can be activated based on groups (choose explicit, then check the ‘Tracking’ options).
Since this is based on group, you will have to login, but you can do that on a default user using security.login(‘aDefaultUser’, anID, [‘agroupWithTracking’]);
Note that once deployed to a real server, security will be enforced by the Servoy server anyway, so you must have some login set in your solution in any case.

Thanks Patrick!

Now audit logging is working but I still need to know what user (from my own login form because I’m not using Servoy security) has changed data.

I tried adding a column to Log table called realuser with a calculation with return globals.globaluser (that has the real user logged into the solution) but null is written. Is it possible to add a column to the Log table and write data into it?

Yes you can add your own column to the log table and fill it using any info you like: Have a look at databaseManager.addTrackingInfo(columnName, value), you should call this one before any call to dabaseManager.saveData()

Great !!!

Thank you very much Patrick. :D