system.perspective.alterLogging
This function is used in Python Scripting.
Description​
Changes Perspective Session logging attributes and levels. All parameters are optional, with the caveat that at least one of them needs to be used.
For the system.perspective.alterLogging
function to work, the following line needs to be added to the ignition.conf
file, and the Gateway restarted. "X" is the next number in the Java Additional Parameters list in the ignition.conf
file. Warning, this will open potential security holes in the Gateway, and is not advised.
wrapper.java.additional.X=-Dperspective.enable-client-logging=true
# Java Additional Parameters
wrapper.java.additional.1=-Ddata.dir=data
wrapper.java.additional.2=-Xdebug
wrapper.java.additional.3=-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000
Syntax​
This function accepts keyword arguments.
system.perspective.alterLogging([remoteLoggingEnabled], [level], [remoteLoggingLevel], [sessionId], [pageId])
Parameters​
Type | Parameter | Description |
---|---|---|
Boolean | remoteLoggingEnabled | Will enable remote logging if True. Remote logging will send log events from the Session to the Gateway under the perspective.client logger if they meet the remoteLevel logging level requirement. [optional] |
String | level | The desired Session logging level. Possible values are: all, trace, debug, info, warn, error, fatal, or off. The default is info. [optional] |
String | remoteLoggingLevel | The desired remote logging level. Possible values are: all, trace, debug, info, warn, error, fatal, off. The default is warn. [optional] |
String | sessionId | Identifier of the Session to target. If omitted, the current Session will be used automatically. When targeting a different session, then the pageId parameter must be included in the call. [optional] |
String | pageId | Identifier of the page to target. If omitted, the current Page will be used automatically. [optional] |
Returns​
Nothing
Scope​
Gateway, Perspective Session
This function will only work in the Gateway scope if both sessionId
and pageId
are supplied to the call.
Code Examples​
# Alter the logging level to trace.
system.perspective.alterLogging(level = 'trace')