Properly log messages. Add function to get port for streaming.