Get Electron Logs
Overview
Step-by-step to display Electron logs from a build run locally
info
Most logs are disabled in Production builds. Either run an STG build, or a prod-debug builds if the issue is exclusive on production environments
Prerequisites
- Required access/permissions: MSIX Azure Pipeline (if needed)
- Required tools: Powershell. The application already installed
- Required knowledge: Powershell commands
When to Use
- When attempting to retrieve Electron logs from a local computer
Procedure
Step 1: Set environment variables
Purpose: This enables some of the runtime logs for analytics
Set the following env variables in your Powershell terminal
$env:ANALYTICS_DEBUG_LEVEL = '2'
$env:ANALYTICS_DEBUG = 'True'
Expected Output: None
Step 2: Run the application through Powershell
Purpose: Running the application through Powershell will allow it to print any logs on that same terminal instance
- Make sure to replace
[YOUR_USERNAME]with the correct username on your Windows computer - If you have a Production (or a
prod-debug) app installed, the exe file should be named ashptvplus.exe. Otherwise it will have a postfix of the environment (eg.hptvplus-stg.exe)
info
For the possible postfixes, see the config on electron/scripts/getEnvConfig.js.
C:\Users\[YOUR_USERNAME]\AppData\Local\Microsoft\WindowsApps\hptvplus.exe
Verification: The app should open after invoking the exe file. And logs should start to appear on that same Powershell instance
Troubleshooting
| Problem | Possible Cause | Solution |
|---|---|---|
| The exe file cannot be found | The app is not installed or does not have the path name used | Make sure you have the proper username after \Users, and that the name of the exe file matches the environment of the installed application |
| Only a portion of the logs are being printed | A production build is being used. Production builds may not print all analytics related logs, due to the environment variables being set at compilation-time, not running time. | If you need to check against a production environment, use the prod-debug environment |
Escalation
If you cannot resolve an issue:
- Slack Channel: #prj-hp-dev
- On-Call Contact: (Accedo) Roberto Chavez