Overhauling logging strategy

logging.

Done. Added tests with invalid XML for streaming and validate.