Skip to content

Commit

Permalink
Merge pull request #3596 from timberhill/safe-encoding-patch
Browse files Browse the repository at this point in the history
replace bad characters before logging them out
  • Loading branch information
ashie authored Jan 11, 2022
2 parents d1f33da + 6a13ba3 commit a0fc60e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/fluent/plugin/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ def multi_workers_ready?

def string_safe_encoding(str)
unless str.valid_encoding?
log.info "invalid byte sequence is replaced in `#{str}`" if self.respond_to?(:log)
str = str.scrub('?')
log.info "invalid byte sequence is replaced in `#{str}`" if self.respond_to?(:log)
end
yield str
end
Expand Down

0 comments on commit a0fc60e

Please sign in to comment.