I want to enable debug messages on bluez

12,620

Solution 1

I have no Ubuntu here at the moment, but this is the way it works on Fedora and I'm sure it is very similar on Ubuntu, especially the systemd-part:

enable debugging by adding a -d after

ExecStart=/usr/libexec/bluetooth/bluetoothd

in /usr/lib/systemd/system/bluetooth.service

Save, then:

$ systemctl daemon-reload
$ systemctl restart bluetooth

Now you get your information in /var/log/syslog

Solution 2

To add to datafridge's answer above, I didn't have /usr/lib/systemd/system/bluetooth.service in Ubuntu 16.04 with BlueZ 5.41.

The file was at /etc/systemd/system/bluetooth.target.wants/bluetooth.service and the entry to be modified was

ExecStart=/usr/lib/bluez5/bluetooth/bluetoothd –d

The logs can also be seen using

journalctl --unit=bluetooth -f
Share:
12,620
Sagar Sm
Author by

Sagar Sm

Updated on July 04, 2022

Comments

  • Sagar Sm
    Sagar Sm almost 2 years

    I am actually trying to figure out where the DBG("") prints are going when I do a music stream using bluez to my headset. So basically I want to know where all the bluez debug messages are getting printed, be it any kind of bluetooth operation. ex: scan, inquiry , connect and so on .

    Hopefully someone can help me with this . Thanks in advance .

    • kaylum
      kaylum almost 8 years
      It's not clear which DBG calls you mean (the kernel? the bluetoothd daemon? the bluetooth client?). But in general kernel messages can be viewed with dmesg and many applications (including bluetoothd) log into syslog which is a file that can be viewed usually as /var/log/syslog.
    • Sagar Sm
      Sagar Sm almost 8 years
      The bluetooth daemon logs is what I mean . There are many DBG(" ") prints inside bluez/profiles/audio in many of the .c files, So my assumption is there may be a file where all these DBG(" ") lines get documented when I do any operation involving A2DP, so that I can know which functions get called and which .c files are getting used during a specific operation. So I just want to know how to enable those. I tried /var/log/syslog but those will have logs only if there are any major changes involving bluetooth . Thanks in advance .