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

    • We collect Bitbucket feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      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

            [BSERV-19782] Add REST API to toggle debug logging and profiling on primary and mirror

            Renata Dornelas made changes -
            Remote Link Original: This issue links to "Page (Atlassian Documentation)" [ 973837 ]
            JP Mariano made changes -
            Remote Link New: This issue links to "Page (Confluence)" [ 975767 ]
            Josh Wang made changes -
            Resolution New: Fixed [ 1 ]
            Status Original: Waiting for Release [ 12075 ] New: Closed [ 6 ]
            Tomasz Prus made changes -
            Remote Link New: This issue links to "Page (Atlassian Documentation)" [ 974024 ]
            Tomasz Prus made changes -
            Remote Link New: This issue links to "Page (Atlassian Documentation)" [ 974023 ]
            Tomasz Prus made changes -
            Remote Link New: This issue links to "Page (Atlassian Documentation)" [ 973857 ]
            Stanley Su made changes -
            Description Original: 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. 
            {code:java}
            $ curl -u admin -X PUT --url '{MIRROR_URL}/rest/api/latest/logs/settings' -H "Content-Type: application/json" --data '{"debugLogging":true,"profiling":true}'{code}

            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|https://developer.atlassian.com/server/bitbucket/rest/v904/api-group-system-maintenance/#api-api-latest-logs-logger-loggername-levelname-put], 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
            {panel:title=Note|borderStyle=solid|borderColor=#3c78b5|titleBGColor=#3c78b5|bgColor=#e7f4fa}
            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
            {panel}
            ----
             

            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+:
            !Screenshot 2025-01-03 at 09.15.41.png|width=485,height=259!
            New: 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. 
            {code:java}
            $ curl -u admin -X PUT --url '{MIRROR_URL}/rest/api/latest/logs/settings' -H "Content-Type: application/json" --data '{"debugLogging":true,"profiling":true}'{code}

            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|https://developer.atlassian.com/server/bitbucket/rest/v904/api-group-system-maintenance/#api-api-latest-logs-logger-loggername-levelname-put], 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+:
            !Screenshot 2025-01-03 at 09.15.41.png|width=485,height=259!

            {panel:title=Note|borderStyle=solid|borderColor=#3c78b5|titleBGColor=#3c78b5|bgColor=#e7f4fa}
            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
            {panel}
            Stanley Su made changes -
            Description Original: 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. 
            {code:java}
            $ curl -u admin -X PUT --url '{MIRROR_URL}/rest/api/latest/logs/settings' -H "Content-Type: application/json" --data '{"debugLogging":true,"profiling":true}'{code}

            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|https://developer.atlassian.com/server/bitbucket/rest/v904/api-group-system-maintenance/#api-api-latest-logs-logger-loggername-levelname-put], 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
            {panel:title=Note|borderStyle=solid|borderColor=#3c78b5|titleBGColor=#3c78b5|bgColor=#e7f4fa}
            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
            {panel}
            ----
             

            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+:
            !Screenshot 2025-01-03 at 09.15.41.png|width=485,height=259!
            New: 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. 
            {code:java}
            $ curl -u admin -X PUT --url '{MIRROR_URL}/rest/api/latest/logs/settings' -H "Content-Type: application/json" --data '{"debugLogging":true,"profiling":true}'{code}

            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|https://developer.atlassian.com/server/bitbucket/rest/v904/api-group-system-maintenance/#api-api-latest-logs-logger-loggername-levelname-put], 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
            {panel:title=Note|borderStyle=solid|borderColor=#3c78b5|titleBGColor=#3c78b5|bgColor=#e7f4fa}
            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
            {panel}
            ----
             

            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+:
            !Screenshot 2025-01-03 at 09.15.41.png|width=485,height=259!
            Stanley Su made changes -
            Link New: This issue resolves BSERV-11198 [ BSERV-11198 ]
            Stanley Su made changes -
            Description Original: 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. 
            {code:java}
            $ curl -u admin -X PUT --url '{MIRROR_URL}/rest/api/latest/logs/settings' -H "Content-Type: application/json" --data '{"debugLogging":true,"profiling":true}'{code}

            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|https://developer.atlassian.com/server/bitbucket/rest/v904/api-group-system-maintenance/#api-api-latest-logs-logger-loggername-levelname-put], 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
            {panel:title=Note|borderStyle=solid|borderColor=#3c78b5|titleBGColor=#3c78b5|bgColor=#e7f4fa}
            If you've upgraded to 9.4.2+ or 9.5.0+, the above settings will take precedence over logging.profiling.enabled or logging.debug.enabled
            {panel}
            Bitbucket Data Center version 8.9.8 detects as being vulnerable to the Terrapin SSH vulnerability. [https://nvd.nist.gov/vuln/detail/CVE-2023-48795
            ----
             

            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+:
            !Screenshot 2025-01-03 at 09.15.41.png|width=485,height=259!
            New: 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. 
            {code:java}
            $ curl -u admin -X PUT --url '{MIRROR_URL}/rest/api/latest/logs/settings' -H "Content-Type: application/json" --data '{"debugLogging":true,"profiling":true}'{code}

            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|https://developer.atlassian.com/server/bitbucket/rest/v904/api-group-system-maintenance/#api-api-latest-logs-logger-loggername-levelname-put], 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
            {panel:title=Note|borderStyle=solid|borderColor=#3c78b5|titleBGColor=#3c78b5|bgColor=#e7f4fa}
            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
            {panel}
            ----
             

            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+:
            !Screenshot 2025-01-03 at 09.15.41.png|width=485,height=259!

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

                Created:
                Updated:
                Resolved: