Implementing Audit Logging without using security

Questions and Answers on installation, deployment, management, locking, tranasactions of Servoy Application Server

Implementing Audit Logging without using security

Postby dfernandez » Mon Jun 04, 2012 10:04 pm

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?
dfernandez
 
Posts: 87
Joined: Wed Feb 29, 2012 4:04 pm

Re: Implementing Audit Logging without using security

Postby ptalbot » Mon Jun 04, 2012 10:30 pm

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.
Patrick Talbot
Freelance - Open Source - Servoy Valued Professional
https://www.servoyforge.net
Velocity rules! If you don't use it, you don't know what you're missing!
User avatar
ptalbot
 
Posts: 1654
Joined: Wed Mar 11, 2009 5:13 am
Location: Montreal, QC

Re: Implementing Audit Logging without using security

Postby dfernandez » Wed Jun 06, 2012 12:33 am

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?
dfernandez
 
Posts: 87
Joined: Wed Feb 29, 2012 4:04 pm

Re: Implementing Audit Logging without using security

Postby ptalbot » Wed Jun 06, 2012 12:58 am

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()
Patrick Talbot
Freelance - Open Source - Servoy Valued Professional
https://www.servoyforge.net
Velocity rules! If you don't use it, you don't know what you're missing!
User avatar
ptalbot
 
Posts: 1654
Joined: Wed Mar 11, 2009 5:13 am
Location: Montreal, QC

Re: Implementing Audit Logging without using security

Postby dfernandez » Wed Jun 06, 2012 5:52 pm

Great !!!

Thank you very much Patrick. :D
dfernandez
 
Posts: 87
Joined: Wed Feb 29, 2012 4:04 pm


Return to Servoy Server

Who is online

Users browsing this forum: No registered users and 7 guests