system.util.audit
This function is used in Python Scripting.
Description​
Inserts a record into an audit profile.
Client Permission Restrictions​
This scripting function has no Client Permission restrictions.
Syntax​
system.util.audit([action], [actionTarget], [actionValue], [auditProfile], [actor], [actorHost], [originatingSystem], [eventTimestamp], [originatingContext], [statusCode])
Parameters​
Type | Parameter | Description |
---|---|---|
String | action | What happened. Default is null. [optional] |
String | actionTarget | What the action happened to. Default is null. [optional] |
String | actionValue | The value of the action. Default is no value. [optional] |
String | auditProfile | Where the audit record should be stored. Defaults to the project’s audit profile (if specified), or the Gateway audit profile if calling in the Gateway or Perspective Session scope. [optional] |
String | actor | Who made the change. Will be populated automatically if omitted, assuming there is a known user. [optional] |
String | actorHost | The hostname of whoever made the change. Will be populated automatically if omitted. [optional] |
List[String] | originatingSystem | An even-length list providing additional context to the audit event. Will be appended to the automatically generated list. Typically, the automatically generated context looks like this:
[“component”, “Joe’sButton”, “field”, “value”] , you would get a record with If a string is provided, this automatic context will not be used and your provided string will be written directly into the originatingSystem column in the audit profile. [optional] |
Date | eventTimestamp | When the event happened. Will be set to the current time if omitted. [optional] |
Integer | originatingContext | What scope the event originated from: 1 means Gateway, 2 means Designer, 4 means Client. Will be set automatically if omitted. [optional] |
Integer | statusCode | A quality code to attach to the object. Defaults to 0, indicating no special meaning. [optional] |
Returns​
Nothing
Scope​
Gateway, Vision Client, and Perspective Session.
Code Examples​
Example #1
# All of the parameters are optional, so you're free to only provide parameters you're interested in.
# In the very least provide just the action you wish to record, which gives the function a chance to look up all of the other parameters automatically.
system.util.audit("The user did a thing!")
Example #2
# Simple example just showing parameter usage.
myAction = "The button was pressed"
myTarget = "My Button"
system.util.audit(action = myAction , actionTarget = myTarget )