Settings file, backup and logs

Where settings are stored

Build File
Installed (BrowserPicker.msi, Dependent.zip) %LOCALAPPDATA%\BrowserPicker\settings.json
Portable (BrowserPicker-Portable.msi, Portable.zip) settings.json in the same folder as BrowserPicker.exe

Older versions stored settings in the registry under HKEY_CURRENT_USER\Software\BrowserPicker. When there is no settings.json yet, Browser Picker copies those settings into a new file on first start. A portable build that has no file of its own copies the installed build’s settings.json instead.

Edit the settings file by hand

The settings window is the main way to configure Browser Picker, but you can also edit settings.json in a text editor. This helps with changes the window doesn’t make easy, such as adding many rules at once.

  • Check your changes with the schema. The file starts with a $schema line that points to the JSON schema. Editors such as Visual Studio Code use it to complete property names and flag mistakes as you type.
  • Changes apply to the next link. Each link starts a new Browser Picker process, which reads the file when it starts.
  • The settings window reloads the file. While the settings window is open, it reloads settings.json shortly after you save it, so the window shows your edit. You don’t need to close it first.
  • Errors are shown at the top of the settings window. If the file can’t be read, for example because of a missing comma or a value of the wrong type, the window shows the error with its line number. Browser Picker keeps using the settings it already had and doesn’t save changes until you fix the file, so your edit isn’t overwritten. When you save a fixed file, the error goes away. A link opened while the file has errors uses the default settings.
  • Comments and trailing commas are allowed, but Browser Picker writes the file again whenever a setting changes, for example when you pick a browser and its usage count goes up. That rewrite removes comments and changes the formatting.
  • If you change the same setting in the window and in the file, the last change wins. Settings changed in the window are saved straight away.

Make a backup first (see below), so you can go back if an edit goes wrong.

Back up and restore

The Backup tab of the settings window can:

  • Export Browser Picker settings to a file, and Import Browser Picker settings from one;
  • Copy settings to the clipboard, and Paste settings from it.

Use these to move your setup to another computer, or to give several people the same rules.

Logs

Browser Picker logs through the standard .NET logging system, to the Windows Event Log (source BrowserPicker) and to the in-app log on the Feedback tab.

The log levels are set in appsettings.json next to BrowserPicker.exe:

  • Logging:LogLevel:Default sets what the app records, including what appears on the Feedback tab. The default is Information.
  • Logging:EventLog:LogLevel:BrowserPicker sets what goes to the Windows Event Log. The default is Warning.

For more detail while you troubleshoot, raise one or both:

{
  "Logging": {
    "LogLevel": {
      "Default": "Debug",
      "System": "Information",
      "Microsoft": "Information"
    },
    "EventLog": {
      "LogLevel": {
        "Default": "Warning",
        "BrowserPicker": "Information"
      }
    }
  }
}

You can also set them with environment variables, such as Logging__LogLevel__Default=Debug or Logging__EventLog__LogLevel__BrowserPicker=Information.

The Level list on the Feedback tab only filters what the viewer shows. It doesn’t change what Browser Picker records.

Diagnostic log file

The diagnostic log options on the Feedback tab

Each link starts a new Browser Picker process, so the log on the Feedback tab only shows the current window. To see how earlier links were handled, turn on Write diagnostic log to file on the Feedback tab. Every process then appends to a daily file in %LOCALAPPDATA%\BrowserPicker\logs, including the Debug lines that explain each decision, whatever the levels in appsettings.json.

  • It is off by default.
  • URLs are reduced to scheme and host, such as https://example.com/[redacted], unless you turn on Include full URLs (path and query). Full URLs can contain private data, so only turn it on while you investigate, then delete the logs.
  • Your user profile path is written as %USERPROFILE%.
  • Delete log files after keeps files for 1, 3, 7 or 30 days. Each file stops growing at 5 MB.
  • Open latest log, Open log folder and Delete log files are next to the options.

If you use a .zip package instead of an installer, register the event source once before logs appear in the Event Log. Run this in an administrator PowerShell window:

New-EventLog -LogName Application -Source BrowserPicker