add optional socket hook to logger

@anthonybishopric  @petertseng 
i'm not sure you can expand a string to a byte array this way, worth some testing