Added logging functions
Added connection logging hook