add logging and use framed codec