Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-19782

Add REST API to toggle debug logging and profiling on primary and mirror

XMLWordPrintable

      9.4.2 and 9.5.0 add public REST API to adjust debug logging and profiling settings dynamically. These behave like the existing admin page (for logging and profiling), and the settings are applied cluster wide and also persisted on restarts. These endpoints are also available on mirror nodes (in which case the setting will apply to the entire farm):

      • `GET /rest/api/latest/logs/settings`
      • `PUT /rest/api/latest/logs/settings`, e.g. 
        $ curl -u admin -X PUT --url '{MIRROR_URL}/rest/api/latest/logs/settings' -H "Content-Type: application/json" --data '{"debugLogging":true,"profiling":true}'

      Previously:

      • There was no way to enable/disable debug logging for multiple loggers on mirrors, particularly the same loggers that are modified when toggling debug logging in the admin page for application nodes. There exists REST API for setting log levels for the root logger or individual loggers, which is more cumbersome and doesn't apply cluster-wide on mirrors (and such settings are gone after restarts)
      • Profiling could not be dynamically enabled/disabled on mirrors (unlike primary)

       

      These endpoints should be beneficial in troubleshooting or diagnosing issues


       

      Note that 9.5.0+ allows debug logging/profiling to be toggled via UI as well (requires both the upstream node and mirror farm to be on  version 9.5.0+:

      Note

      If you've upgraded to 9.4.2+ or 9.5.0+, the above settings will take precedence over the logging.profiling.enabled or logging.debug.enabled config properties, in which case you can remove those properties

            c95a692b3157 Stanley Su
            c95a692b3157 Stanley Su
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: