How to enable debug logging for Bitbucket Apps?
Debug logs are essential for us to reproduce and understand potential issues with our apps.
If you submit a bug report, please include a log from Bitbucket with debugging enabled for the specific app.
Enabling debug logging for Bitbucket does NOT enable debug logging for installed apps. However, the app log is part of the Bitbucket log, including log rotation.
Steps to Enable Debug Logging for a Bitbucket App
1. (Option A) Enable Debug Logging via Admin Section
Most apps have a debug log toggle in the admin section:
Go to the admin section of your Bitbucket instance.
Navigate to the specific app settings.
Enable debug logging from there.
1. (Option B) Enable Debug Logging via REST API
If the admin section does not have the debug log toggle, you can enable it using the REST API:
curl -u <YOUR_USER> -v -X PUT -d "" -H "Content-Type: application/json" \
<YOUR_SERVER>/rest/api/latest/logs/logger/<LOGGER_NAME>/debug
Replace the placeholders with your details:
YOUR_USER: Your Bitbucket username (must have admin privileges)
YOUR_SERVER: The base URL of your Bitbucket instance
PLUGIN_KEY: The key of the app to enable debug logging for (refer to the table below for the key)
Example:
$ curl -u admin -v -X PUT -d "" -H "Content-Type: application/json" http://10.0.1.1/bitbucket/rest/api/latest/logs/logger/ch.mibex.stash.cra/debug
If successful, you’ll see: HTTP/1.1 204 No Content
2. Reproduce the Issue and Collect Logs
Reproduce the issue with debug logging enabled.
Collect the debug logs from BITBUCKET_HOME_DIRECTORY/log/atlassian-bitbucket.log
file.
3. Attach the Logs to Your Support Ticket
Provide any additional details about the issue to help our support team understand the context.
4. Disable Debug Logging in
After collecting the logs and resolving the issue, you can disable debug logging via the admin section.
If you used the Rest API, you can reset logging to the warn
log-level with:
curl -u <YOUR_USER> -v -X PUT -d "" -H "Content-Type: application/json" \
<YOUR_SERVER>/rest/api/latest/logs/logger/<LOGGER_NAME>/warn
App Keys Bitbucket Apps
App | Logger Name | Logger Name |
---|---|---|
Activity Streams for Bitbucket | ch.mibex.stash.rss4stash | ch.mibex.stash.rss4stash |
Checklist Buddy for Bitbucket | mibex-checklist-buddy | ch.mibex.bitbucket.prtask |
Code Owners for Bitbucket | mibex-codeowners | ch.mibex.bitbucket.codeowners |
Code Review Assistant for Bitbucket | mibex-code-review-assistant | ch.mibex.stash.cra |
Create Branch Wizard for Bitbucket | ch.mibex.bitbucket.createbranchwizard | ch.mibex.bitbucket.createbranchwizard |
Include Code Quality for Bitbucket (formerly Sonar™ for Bitbucket) | mibex-sonar | ch.mibex.stash.sonar4stash |
Pull Request Please for Bitbucket | ch.mibex.stash.prp | ch.mibex.stash.prp |
Repository Dashboard for Bitbucket | ch.mibex.stash.reposummary4stash | ch.mibex.stash.reposummary4stash |
Repository Templates for Bitbucket | mibex-repository-templates | ch.mibex.stash.templates |
SONAR™, SONARQUBE™ and SONARCLOUD™ are independent and trademarked products and services of SonarSource SA: see sonarsource.com, sonarqube.org, sonarcloud.io.