Logging without database
You can also use auditing without activating the system database ASYS_AUDIT and the resulting high data volume. To do this, auditing must also be activated for the individual tables (thus data is also written to the database), but the audit table can also be cleaned up if desired.
For this you need a process 'process_audit', this must be included in the process editor of the ADITO Designer. Here are some local variables available.
Variable | Description |
---|---|
$local.action | I / U / D for the respective SQLAction. |
$local.user | User who will execute the change. |
$local.timestamp | Time of change. |
$local.alias | Alias of the change. |
$local.table | Table of the affected record. |
$local.idvalue | ID value of the record in question. |
$local.columns | Affected columns (array). |
$local.values | New values (array). |
$local.oldvalues | Old values (array). |
Process and Change should not be used here.
Example
The following code could be available as process_audit:
import("system.logging");
import("system.vars");
logging.log("Audit");
logging.log(" " + vars.getString("$local.action"));
logging.log(" " + vars.getString("$local.user"));
logging.log(" " + vars.getString("$local.timestamp"));
logging.log(" " + vars.getString("$local.alias"));
logging.log(" " + vars.getString("$local.table"));
logging.log(" " + vars.getString("$local.idvalue"));
var xx = vars.get("$local.columns");
try
{
if (xx != null && xx != undefined)
xx = xx.join("-");
}
catch(ex) {}
logging.log(" " + xx);
var xx = vars.get("$local.values");
try
{
if (xx != null && xx != undefined)
xx = xx.join("-");
}
catch(ex) {}
logging.log(" " + xx);
var xx = vars.get("$local.oldvalues");
try
{
if (xx != null && xx != undefined)
xx = xx.join("-");
}
catch(ex) {}
logging.log(" " + xx);
When a change is made, the following output is then written to the
output console (e.g. when the server is started via server.bat):
Audit
U
Admin
1329474637822
AO_DATEN
ORG
ebece025-cc5c-4169-a4bc-b8c130fc1fb1
ORGNAME-DATE_EDIT
M&M Haider und Wagnermaier GmbH-1329474633000
M&M Haider und Wagnermaier AG-1329470942000