Skip to main content
Version: 8.1

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.

caution

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
Example
# 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​

tip

This function accepts keyword arguments.

system.perspective.alterLogging([remoteLoggingEnabled], [level], [remoteLoggingLevel], [sessionId], [pageId])

Parameters​

TypeParameterDescription
BooleanremoteLoggingEnabledWill 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]
StringlevelThe desired Session logging level. Possible values are: all, trace, debug, info, warn, error, fatal, or off. The default is info. [optional]
StringremoteLoggingLevelThe desired remote logging level. Possible values are: all, trace, debug, info, warn, error, fatal, off. The default is warn. [optional]
StringsessionIdIdentifier 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]
StringpageIdIdentifier of the page to target. If omitted, the current Page will be used automatically. [optional]

Returns​

Nothing

Scope​

Gateway, Perspective Session

note

This function will only work in the Gateway scope if both sessionId and pageId are supplied to the call.

Code Examples​

Code Snippet

# Alter the logging level to trace.
system.perspective.alterLogging(level = 'trace')