Enable Debug Logging
Â
Use REST API to change the logging level for the plugin package. The logging configuration in the Bitbucket admin area only affects Bitbucket packages.
Enable debug output
You have two possibilities, activate general debug output or just for the needed classes:
General debug
To enable debug logging, execute the following command:
curl -u admin:<password> -v -X PUT -H "Content-Type: application/json" <bitbucket url>/rest/api/latest/logs/logger/com.nerdwin15.stash.webhook/debug
To disable the debug output, restart your Bitbucket or run the following command:
curl -u admin:<password> -v -X PUT -H "Content-Type: application/json" <bitbucket url>/rest/api/latest/logs/logger/com.nerdwin15.stash.webhook/info
Example of logs entries for notification of Bitbucket Branch Source  plugin
[INFO] 2018-09-21 12:27:54,623 DEBUG [JenkinsWebhook:thread-1] c.n.s.w.n.BitbucketSourceNotifier Payload is : '{"repository":{"scmId":"git","project":{"key":"PROJECT_1","name":"Project 1"},"slug":"rep_1","links":{"self":[{"href":"http://localhost:7990/bitbucket/projects/PROJECT_1/repos/rep_1/browse"}]},"public":false,"ownerName":"PROJECT_1"},"push":{"changes":[{"created":true,"closed":false,"old":null,"new":{"type":"branch","name":"feature-1","target":{"hash":"1623a82c155ac747acb335d8b236d0108f1fcd30","type":"commit"}}}]}}'
Example of logs entries for Git Plugin
Debugging on the Jenkins side
The plugin sends requests to Jenkins via the Jenkin Git Plugin URL http://<Jenkins URL>/git/notifyCommit?url=<SCM URL>
.
Using the Jenkins logger
Jenkins has its own logging system. For more information on gathering Jenkins logs, see CloudBees instructions here.
Examining the Git Polling Log
You can also examine the Git Polling Log on the Job configuration page. The Git Plugin only polls the repository if the URL and the branch match one of the jobs' configurations (all jobs using the Git Plugin are allowed to poll if they match the request sent by Bitbucket).
Â