diff --git a/lib/log-courier/server.rb b/lib/log-courier/server.rb index 63274b3f..76651d62 100644 --- a/lib/log-courier/server.rb +++ b/lib/log-courier/server.rb @@ -53,8 +53,9 @@ def get_json_parseerror def initialize(options = {}) @options = { - logger: nil, - transport: 'tls', + logger: nil, + transport: 'tls', + raw_events: true, }.merge!(options) @logger = @options[:logger] @@ -199,7 +200,7 @@ def process_jdat(message, comm, event_queue) # Decode the JSON begin - event = self.class.get_json_adapter.load(data_buf, :raw => true) + event = self.class.get_json_adapter.load(data_buf, :raw => @options[:raw_events]) rescue self.class.get_json_parseerror => e @logger.warn e, :invalid_encodings => invalid_encodings, :hint => 'JSON parse failure, falling back to plain-text' unless @logger.nil? event = { 'message' => data_buf }