Accessing Diagnostic Logs in Perspective

  1. It is possible to display the gateway log viewer (https://[ipaddress]/web/status/diag.logviewer) through a Perspective Inline Frame component. In my implementation I had Config > Security > General > Status Page Permissions left blank (public security level). I am not exactly sure what obstacles a more restricted security setup might introduce.
  2. It appears very possible to retrieve logger information (as suggested by @PGriffith) and potentially build build your own log viewer in Perspective . Here is a starting point I derived from code provided by @kgamble (and left here for my own future reference).
from com.inductiveautomation.ignition.gateway import IgnitionGateway
from com.inductiveautomation.ignition.common.logging import LogQueryConfig
	
loggingManager = IgnitionGateway.get().getLoggingManager()
	
logQueryConfigBuilder = LogQueryConfig.newBuilder()
# May add filters to LogQueryConfigBuilder object

logQueryFilter = logQueryConfigBuilder.build()
# May add filters to LogQueryFilter object

logQueryFilter.setLimit(10)
	
logResults = loggingManager.queryLogEvents(logQueryFilter)
	
logEvents = logResults.getEvents()

events = []
for event in logEvents:
	events.append({
		 'exception' : event.getException()
		,'level'     : event.getLevel()
		,'loggerName': event.getLoggerName()
		,'marker'    : event.getMarker()
		,'message'   : event.getMessage()
		,'properties': event.getProperties()
		,'source'    : event.getSourceLocation()
		,'timestamp' : system.date.fromMillis(event.getTimestamp())
	})

There are lots of filtering options than can be applied using methods available on the LogQueryConfigBuilder and LogQueryConfig class objects.

Screenshot showing gateway log viewer exposed in Perspective Inline Frame component.