Enabling debug logging
Should you have issues with Security for Bitbucket, turning on debug logging can help to troubleshoot and diagnose them.
Additional Logging Setting
In the plugin configuration, you can enable additional logging under the Security for Bitbucket Settings heading by toggling the Enable additional logging switch.
![](../../__attachments/14825226318/localhost_7990_bitbucket_plugins_servlet_security-for-bitbucket-settings.png?inst-v=dd2e15ff-a066-4891-84cc-df8425dc8a25)
Security for Bitbucket Settings page, with a switch labeled Enable additional logging, just above the Global Scanning Rules heading.
This makes all Debug and Info level messages log as Warn messages on all nodes until the setting is turned off.
Interaction With Bitbucket Logging Configuration
Bitbucket allows more granular configuration of logging. Soteri recommends using the “Enable additional logging” setting to troubleshoot any issue with Security for Bitbucket. However, if for any reason you decide to use the Bitbucket logging configuration, it will not conflict with the Additional Logging Setting.
Enabling logging for database SQL commands
Logging all SQL commands will generate extremely verbose logs. It should only be enabled temporarily, at the instruction of our support team.
Similar to turning on debug logging for the Security for Bitbucket plugin, trace level logging to see raw SQL commands to the Bitbucket database can be enabled by setting the log level for the following packages:
curl -X PUT -u admin https://{bitbucket.server}/rest/api/latest/logs/logger/org.hibernate.sql/debug
curl -X PUT -u admin https://{bitbucket.server}/rest/api/latest/logs/logger/net.java.ao.sql/debug
curl -X PUT -u admin https://{bitbucket.server}/rest/api/latest/logs/logger/com.querydsl.sql/debug
and can be undone by setting the log levels back to info
:
curl -X PUT -u admin https://{bitbucket.server}/rest/api/latest/logs/logger/org.hibernate.sql/info
curl -X PUT -u admin https://{bitbucket.server}/rest/api/latest/logs/logger/net.java.ao.sql/info
curl -X PUT -u admin https://{bitbucket.server}/rest/api/latest/logs/logger/com.querydsl.sql/info