How do I set the debug level?

Each of the daemons normally has debug messages compiled into the program, but these are disabled by default. 
There are two ways to enable the debug output:

The first way of getting debug output is to dynamically turn it on using the Console using the setdebug level=nnn command.

 Log into bconsole, use the following commands: 
 - To enable debug for a storage called 'File' (use your own storage name here, with 'tab' after storage=, you will get a list: 
setdebug level=150 trace=1 timestamp=1 storage=File
- To enable debug for the director:
setdebug level=150 trace=1 timestamp=1 dir
- To enable debug for a client (in this example for client named 'centos-fd' 
setdebug level=150 trace=1 timestamp=1 client=centos-fd

In all cases you get an answer, which contains the file names, where the debug is written, 
2000 OK setdebug=150 trace=1 hangup=0 timestamp=1 tracefile=/var/lib/bareos/centos-fd
The file will be written on the machine, where the respective daemon runs in the working directory. 
Be aware that debug-files might get quite large. 

To deactivate the debug, use the same commands as above but with 'level=0 trace=0'
setdebug level=0 trace=0 client=centos-fd
In rare cases, when you want to debug all daemons (including remote clients and storages) you can use the special keyword all.
setdebug level=100 trace=1 timestamp=1 all

The second one is to add the -d nnn option on the command line when starting the daemon. 
This is more used in conjunction with the -t for debugging configuration trouble.