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
BASH

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
BASH

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"}}}]}}'
CODE

Example of logs entries for Git Plugin

[INFO] 2019-03-11 18:57:15,240 DEBUG [JenkinsWebhook:thread-1]  c.n.s.w.notifier.GitPluginNotifier Successfully triggered jenkins with url 'http://localhost:8080/jenkins/git/notifyCommit?url=http://localhost:7990/bitbucket/scm/project_1/rep_1.git&branches=master&sha1=afe80a53ddc56e6fe4a88799c379716e79c167d6':
CODE

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).