Logger
The logger is a global server configuration property which allows the input and output of function calls, get variable operations, and set variable operations to be logged or otherwise processed.
When the session logger is enabled, all function calls and variable operations will be passed to the indicated expression. The expression can be used to filter out particular functions or variable operations for asynchronous processing.
Session Logger Configuration
This group contains options which govern how the logger operates.
Enabled
Indicates if logging is enabled.
Property name: enabled
Property type: Boolean
Expression
Expression to filter events for logging and indicates how the filtered data should be processed.
Property name: expression
Property type: String
Normal Concurrent Tasks
The default number of threads to be maintained for processing logging tasks.
Property name: normalLoggerConcurrentWorkers
Property type: Integer
Maximum Concurrent Tasks
The maximum number of threads which can be activated to process tasks as queue length grows.
Property name: maximumLoggerConcurrentWorkers
Property type: Integer
Maximum Unprocessed Tasks Queue Length
Maximum number of tasks which can be queued. When the task queue has reached this maximum, additional tasks will be discarded.
Property name: maximumLoggerQueueLength
Property type: Integer
Resolution Environment
Session Logger Expression Resolution Environment: | | ||
The context of the variable or function which is being logged. Note that this is available in the environment variable | |||
Data Table containing event-specific data for triggering event. | |||
0 | |||
Variable Name | Value Type | Description | |
---|---|---|---|
address | String | IP address of the client. | |
context | String | Full path to the operation's context. | |
duration | Long | Execution time of the operation. | |
entityName | String | Name of the function or variable. | |
input | String | Input parameters (function input or value for variable set operation)/ | |
login | String | Login name of the user executing the operation | |
operationType | String | Type of operation, one of the following:
| |
output | String | Output parameters (function output or retrieved value from get variable operation) | |
sessionId | Integer | Id of the current session | |
username | String | Username |
Example Session Logger Expression
![]() | All function and variable operations will trigger the expression. Take care to craft an expression which processes the precise operations of interest and logs the desired data without overtaxing system resources. |
The following example first filters for entities named criticalContext
. In this case it will filter for calls to functions named criticalContext
and get or set operations on variables named criticalContext
.
If this criteria is met, the function log
is called in the example device sampleCollector
and logs the following information concatenated into a string:
now()
- The current timestamp.
{context}
- The default context.
{operationType}
- Indicates if the logged operation was a function call or getting or setting a variable.
{entityName}
- The name of the variable or function called. In this example it will always be criticalContext
.
{duration}
- The amount of time spent executing the function call or get/set variable operation.
{entityName} == "criticalContext" ?
callFunction("users.admin.devices.sampleCollector", "log", now() + "', '" + {context} + "', '" + {operationType} + "', '" + {entityName} + "', " + {duration} + ")", true)
:
Was this page helpful?