Support and Debugging

OpenFin provides application providers with the tools needed to support their applications and customers. These features range from the Chromium DevTools to API calls for collecting raw data about a user’s machine.

Debugging your app

We provide you with the Chrome DevTools for easy and efficient debugging. There are two ways to debug your OpenFin app:

Option 1

  1. Launch Chrome browser
  2. Enter the following URL: http://localhost:9090
  3. You’ll see a list of the running web pages. Select the page you’d like to debug

Option 2

Set the contextMenu to true in your app config JSON file as followings:

"startup_app": {
    …
    "contextMenu": true
}

With this setting, you’ll be able to right-click on your app and select Inspect Element to open developer tools.

Diagnostics mode

Diagnostics mode provides you and your end-users an opportunity to recreate previously reported issues within your application and remotely deliver the runtime debug logs. This feature is tremendously useful for troubleshooting isolated issues on a specific desktop that is not directly physically accessible. The feature is opt-in, can be configured in your application config or triggered from the command line. Runtime 8.53.24.41+ and RVM 3.6.1+

When enabled, end users can launch your application in this mode from a secondary start-menu item labeled “ (Diagnostics Mode)”. When your application runs in diagnostics mode, the OpenFin Runtime supports the following:

  • Verbose logging defaults to On ( --v=1)
  • Crash / Debug logs delivered on Runtime crash or application close
  • Logs delivered to OpenFin (a subsequent enhancement will enable delivery to app providers)

Diagnostics mode can also be manually triggered by adding “--diagnostics” to the command line for the application.

Automatic creation of a diagnostics mode shortcut is an opt-in feature which can be set in your application config:

“shortcut”: {   “diagnostics-shortcut”: true,  }

Crash Reporting tool

For a Runtime crash, OpenFin 6+ allows you to enter the following arguments in your app config:

"runtime": {
    "arguments": "--enable-crash-reporting --no-sandbox"
    },

If a machine has access to OpenFin’s CDN, a crash report is automatically delivered to OpenFin and a support ticket is automatically created. If not, minidmp file(s) are written to %localappdata%\temp\OpenFin Crashes.

Memory profiling

Through DevTools, Chromium offers a comprehensive set of tools to profile your application. This tutorial is a good resource for application developers.

Verbose logging

OpenFin provides two levels of logging features.

  1. Basic - default is always on
  2. Verbose - (--v=1) which needs to be turned on via an argument in your app config (see below)
"runtime": {
    "arguments": "--v=1"
    },

❗️

Verbose Logging in Production Environments

Please note that the Verbose logging setting --v=1 is a runtime switch which enables chromium verbosity logging and subsequently increases the volume of messages written to the log. When in a Production environment, this setting can result in excessive log sizes on the local system.

OpenFin recommends ONLY using this setting in a Production environment for isolated situations where debugging a production issue is required. Remember to turn verbosity off when debugging is completed.

Best Practice

In an effort to limit the log file sizes, Application Providers can enable verbose logging through the System.setMinLogLevel API call to facilitate debugging from their application code:

fin.System.setMinLogLevel("verbose");

This programatic approach is perfect for diagnosing issues in a Production environment. Applications can provide this setting embedded in their applications preferences where an end-user can enable the logging while trying to replicate the issue. This same setting can then be switched off by the user in the same location it was enabled, restarting the application or programmatically 'Schedule a Restart', and close the running Runtime:

System.exit() - (https://developer.openfin.co/docs/javascript/stabl/System.html#exit);```

# APIs
OpenFin offers several API calls that can be used directly by application providers for their support needs. More details on these calls can be found in [`fin.System`](https://cdn.openfin.co/docs/javascript/stable/System.html).

OpenFin recommends logging information on a regular basis from the client back to your server/db, as well as active metric gathering when an error or other issue occurs in your application.

Some critical APIs in System are:

* [getProcessList](https://cdn.openfin.co/docs/javascript/stable/tutorial-System.getProcessList.html)
* [getAllExternalApplications](https://cdn.openfin.co/docs/javascript/stable/tutorial-System.getAllExternalApplications.html)
* [getHostSpecs](https://cdn.openfin.co/docs/javascript/stable/tutorial-System.getHostSpecs.html)
* [getLog](https://cdn.openfin.co/docs/javascript/stable/tutorial-System.getLog.html)
* [log](https://cdn.openfin.co/docs/javascript/stable/tutorial-System.log.html)
* [getMinLogLevel](https://cdn.openfin.co/docs/javascript/stable/tutorial-System.getMinLogLevel.html)
* [setMinLogLevel](https://cdn.openfin.co/docs/javascript/stable/tutorial-System.setMinLogLevel.html)
* [getRvmInfo](https://cdn.openfin.co/docs/javascript/stable/tutorial-System.getRvmInfo.html)
* [getMonitorInfo](https://cdn.openfin.co/docs/javascript/stable/tutorial-System.getMonitorInfo.html)

**Have questions? Get in touch with us at <[email protected]>.**

 

Did this page help you?