Move debugging into the driver to get logging from the first moment

Currently, the debug output starts right after the start of the session. This commit will make sure that the whole communication is listed in http debug-mode.