vectordotdev / timber-ruby

🌲 Great Ruby logging made easy.
https://timber.io
Other
154 stars 19 forks source link

Log event JSON encoding is attempting to encode binary data #163

Closed binarylogic closed 7 years ago

binarylogic commented 7 years ago

When a controller takes a file upload it produces binary data in the resulting controller parameters. Those parameters are captured in the controller_call event which is subsequently encoded into JSON. The binary data is ASCII-8BIT which contains characters outside of the defined valid set for UTF-8, and it throws this error:

Could not log "start_processing.action_controller" event. Encoding::UndefinedConversionError: "\xD0" from ASCII-8BIT to UTF-8

As part of hash preparation for Timber::LogEvent we should drop keys with binary data.