Skip to content

Commit

Permalink
Remove 'utc' field from TimeSlicedOutput conf to prevent ConfigError
Browse files Browse the repository at this point in the history
Helpers/Compat utils can't judge user specifies both localtime/utc or converted result.
This changes conf dumpped result but it seems acceptable.
  • Loading branch information
repeatedly committed Nov 21, 2016
1 parent ad48174 commit 70aeaaa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/fluent/compat/output.rb
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,7 @@ def configure(conf)
elsif conf['utc']
conf['timezone'] = "+0000"
conf['localtime'] = "false"
conf.delete('utc')
elsif conf['localtime']
conf['timezone'] = Time.now.strftime('%z')
conf['localtime'] = "true"
Expand Down
10 changes: 10 additions & 0 deletions test/test_output.rb
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,16 @@ def create_driver(conf=CONFIG)
Fluent::Test::TimeSlicedOutputTestDriver.new(TimeSlicedOutputTestPlugin).configure(conf, true)
end

data(:none => '',
:utc => "utc",
:localtime => 'localtime',
:timezone => 'timezone +0000')
test 'configure with timezone related parameters' do |param|
assert_nothing_raised {
create_driver(CONFIG + param)
}
end

sub_test_case "test emit" do
setup do
@time = Time.parse("2011-01-02 13:14:15 UTC")
Expand Down

0 comments on commit 70aeaaa

Please sign in to comment.