Currently when an object, anything other than a String, is passed to a log method the object will be converted to a String in one of three ways:
calling to_s on the object
converting via the inspect method
and creating a YAML representation
For some logging destinations, it would be really nice to be able to generate a JSON representation of the object provided it is a Hash of key / value pairs or an Array of [key, value] pairs. This type of output would work nicely with MongoDB logging and with the Parseable JSON formatter.
Currently when an object, anything other than a String, is passed to a log method the object will be converted to a String in one of three ways:
to_s
on the objectinspect
methodFor some logging destinations, it would be really nice to be able to generate a JSON representation of the object provided it is a Hash of key / value pairs or an Array of [key, value] pairs. This type of output would work nicely with MongoDB logging and with the Parseable JSON formatter.