added logger info for to_bytes method