Iterating over the private variables of an object breaks encapsulation and makes the code prone to failure. If there was a method like `Puppet::Util::Log#to_hash` defined so you could call `msg.to_hash` and then transform that into the format expected by logstash, would that solve your problem?