Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Watson1978 committed Jan 6, 2025
1 parent b9fc438 commit 855483b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/fluent/plugin/formatter_out_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def format(tag, time, record)
header = ''
header << "#{@timef.format(time)}#{@delimiter}" if @output_time
header << "#{tag}#{@delimiter}" if @output_tag
"#{header}#{Yajl.dump(record)}#{@newline}"
"#{header}#{JSON.generate(record)}#{@newline}"
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/fluent/plugin/storage_local.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def save
return if @on_memory
tmp_path = @path + '.tmp.' + Fluent::UniqueId.hex(Fluent::UniqueId.generate)
begin
json_string = Yajl::Encoder.encode(@store, pretty: @pretty_print)
json_string = JSON.generate(@store)
File.open(tmp_path, 'w:utf-8', @mode) { |io| io.write json_string; io.fsync }
File.rename(tmp_path, @path)
rescue => e
Expand Down

0 comments on commit 855483b

Please sign in to comment.