diff --git a/lib/fluent/plugin/out_cloudwatch_logs.rb b/lib/fluent/plugin/out_cloudwatch_logs.rb index ce62913..fa7cb25 100644 --- a/lib/fluent/plugin/out_cloudwatch_logs.rb +++ b/lib/fluent/plugin/out_cloudwatch_logs.rb @@ -7,8 +7,6 @@ module Fluent::Plugin class CloudwatchLogsOutput < Output Fluent::Plugin.register_output('cloudwatch_logs', self) - class TooLargeEventError < Fluent::UnrecoverableError; end - helpers :compat_parameters, :inject, :formatter DEFAULT_BUFFER_TYPE = "memory" @@ -379,7 +377,8 @@ def put_events_by_chunk(group_name, stream_name, events) while event = events.shift event_bytesize = event[:message].bytesize + EVENT_HEADER_SIZE if MAX_EVENT_SIZE < event_bytesize - raise TooLargeEventError, "Log event in #{group_name} is discarded because it is too large: #{event_bytesize} bytes exceeds limit of #{MAX_EVENT_SIZE}" + log.warn "Log event in #{group_name} is discarded because it is too large: #{event_bytesize} bytes exceeds limit of #{MAX_EVENT_SIZE}" + break end new_chunk = chunk + [event]