Logger
The Logger is a global server configuration property which allows the input and output of selected context function calls, as well as selected context variable read/write operations, to be logged or otherwise processed.
When the logger is enabled, all function calls and variable operations will be passed to the special logger expression. The expression is used to filter and process particular functions or variable operations.
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 | ||||||||||||||||||||||||||||||||||
|
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?