Add some logging.
Allow overriding the protocol.