Ok Joli!
Here is the way I do this.
At the begining of your kamailio.cfg, just after "#!KAMAILIO" insert this define:
#!define WITH_DEBUG
In your global parameters, you must now define what happens if "WITH_DEBUG" is configurated, so add these lines:
#!ifdef WITH_DEBUG
debug=4
log_stderror=yes
#!else
debug=2
log_stderror=no
#!endif
On Modules Selection, load the module debbuger.so:
#!ifdef WITH_DEBUG
loadmodule "debugger.so"
#!endif