fluentd 1.15.2-x64-mingw32 → 1.16.0-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/linux-test.yaml +2 -2
- data/.github/workflows/macos-test.yaml +2 -2
- data/.github/workflows/windows-test.yaml +2 -2
- data/CHANGELOG.md +96 -0
- data/MAINTAINERS.md +2 -0
- data/README.md +0 -1
- data/fluentd.gemspec +2 -2
- data/lib/fluent/command/fluentd.rb +55 -64
- data/lib/fluent/config/yaml_parser/loader.rb +18 -1
- data/lib/fluent/daemon.rb +2 -4
- data/lib/fluent/file_wrapper.rb +137 -0
- data/lib/fluent/log/console_adapter.rb +66 -0
- data/lib/fluent/log.rb +35 -5
- data/lib/fluent/oj_options.rb +1 -2
- data/lib/fluent/plugin/base.rb +5 -7
- data/lib/fluent/plugin/buf_file.rb +32 -3
- data/lib/fluent/plugin/buf_file_single.rb +32 -3
- data/lib/fluent/plugin/buffer/file_chunk.rb +1 -1
- data/lib/fluent/plugin/buffer.rb +21 -0
- data/lib/fluent/plugin/in_tail.rb +1 -6
- data/lib/fluent/plugin/in_tcp.rb +4 -2
- data/lib/fluent/plugin/out_file.rb +0 -4
- data/lib/fluent/plugin/out_forward/ack_handler.rb +19 -4
- data/lib/fluent/plugin/out_forward.rb +2 -2
- data/lib/fluent/plugin/out_secondary_file.rb +39 -22
- data/lib/fluent/plugin/output.rb +49 -12
- data/lib/fluent/plugin_helper/http_server/server.rb +2 -1
- data/lib/fluent/supervisor.rb +157 -232
- data/lib/fluent/test/driver/base.rb +11 -5
- data/lib/fluent/test/driver/filter.rb +4 -0
- data/lib/fluent/test/startup_shutdown.rb +6 -8
- data/lib/fluent/version.rb +1 -1
- data/test/command/test_ctl.rb +1 -1
- data/test/command/test_fluentd.rb +168 -22
- data/test/command/test_plugin_config_formatter.rb +0 -1
- data/test/compat/test_parser.rb +5 -5
- data/test/config/test_system_config.rb +0 -8
- data/test/log/test_console_adapter.rb +110 -0
- data/test/plugin/out_forward/test_ack_handler.rb +39 -0
- data/test/plugin/test_base.rb +98 -0
- data/test/plugin/test_buf_file.rb +62 -23
- data/test/plugin/test_buf_file_single.rb +65 -0
- data/test/plugin/test_in_http.rb +2 -3
- data/test/plugin/test_in_monitor_agent.rb +2 -3
- data/test/plugin/test_in_tail.rb +105 -103
- data/test/plugin/test_in_tcp.rb +15 -0
- data/test/plugin/test_out_file.rb +3 -2
- data/test/plugin/test_out_forward.rb +14 -18
- data/test/plugin/test_out_http.rb +1 -0
- data/test/plugin/test_output.rb +269 -0
- data/test/plugin/test_parser_regexp.rb +1 -6
- data/test/plugin_helper/test_http_server_helper.rb +1 -1
- data/test/plugin_helper/test_server.rb +10 -5
- data/test/test_config.rb +57 -21
- data/test/{plugin/test_file_wrapper.rb → test_file_wrapper.rb} +2 -2
- data/test/test_formatter.rb +23 -20
- data/test/test_log.rb +85 -40
- data/test/test_supervisor.rb +300 -283
- metadata +15 -24
- data/.drone.yml +0 -35
- data/.github/workflows/issue-auto-closer.yml +0 -12
- data/.github/workflows/stale-actions.yml +0 -22
- data/.gitlab-ci.yml +0 -103
- data/lib/fluent/plugin/file_wrapper.rb +0 -131
- data/test/test_logger_initializer.rb +0 -46
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06e53960a903a2e34015eb819cb74d03829ba193f820970ccdbf9c06815c4646
|
4
|
+
data.tar.gz: 9a27d925cc56edd7c6108aa1740136bd6ae52cc7fd9253cd7d5b52f02562953a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3038de9a095a4321f17583c8f0d93e53e4ff6078e68a54e022a2bb3a38623dbf7e527123b5a740faa6daaf84239c8af730ddd6b8eaa8d7959a441c2d918e1a3a
|
7
|
+
data.tar.gz: 2f50c0bf2e83110c88d9cfa00d2a03383848c15e2365eab27d9df9fb8628127ec3db14df5356562e52617745af251db1cf4ee7c6f377a21801a548fb8334ef73
|
@@ -13,7 +13,7 @@ jobs:
|
|
13
13
|
strategy:
|
14
14
|
fail-fast: false
|
15
15
|
matrix:
|
16
|
-
ruby-version: ['3.1', '3.0', '2.7']
|
16
|
+
ruby-version: ['3.2', '3.1', '3.0', '2.7']
|
17
17
|
os: [ubuntu-latest]
|
18
18
|
experimental: [false]
|
19
19
|
include:
|
@@ -23,7 +23,7 @@ jobs:
|
|
23
23
|
|
24
24
|
name: Unit testing with Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }}
|
25
25
|
steps:
|
26
|
-
- uses: actions/checkout@
|
26
|
+
- uses: actions/checkout@v3
|
27
27
|
- name: Set up Ruby
|
28
28
|
uses: ruby/setup-ruby@v1
|
29
29
|
with:
|
@@ -13,7 +13,7 @@ jobs:
|
|
13
13
|
strategy:
|
14
14
|
fail-fast: false
|
15
15
|
matrix:
|
16
|
-
ruby-version: ['3.1', '3.0', '2.7']
|
16
|
+
ruby-version: ['3.2', '3.1', '3.0', '2.7']
|
17
17
|
os: [macos-latest]
|
18
18
|
experimental: [true]
|
19
19
|
include:
|
@@ -23,7 +23,7 @@ jobs:
|
|
23
23
|
|
24
24
|
name: Unit testing with Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }}
|
25
25
|
steps:
|
26
|
-
- uses: actions/checkout@
|
26
|
+
- uses: actions/checkout@v3
|
27
27
|
- name: Set up Ruby
|
28
28
|
uses: ruby/setup-ruby@v1
|
29
29
|
with:
|
@@ -13,7 +13,7 @@ jobs:
|
|
13
13
|
strategy:
|
14
14
|
fail-fast: false
|
15
15
|
matrix:
|
16
|
-
ruby-version: ['3.1', '2.7']
|
16
|
+
ruby-version: ['3.2', '3.1', '2.7']
|
17
17
|
os:
|
18
18
|
- windows-latest
|
19
19
|
experimental: [false]
|
@@ -35,7 +35,7 @@ jobs:
|
|
35
35
|
|
36
36
|
name: Unit testing with Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }}
|
37
37
|
steps:
|
38
|
-
- uses: actions/checkout@
|
38
|
+
- uses: actions/checkout@v3
|
39
39
|
- name: Set up Ruby
|
40
40
|
uses: ruby/setup-ruby@v1
|
41
41
|
with:
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,101 @@
|
|
1
|
+
# v1.16
|
2
|
+
|
3
|
+
## Release v1.16.0 - 2023/03/29
|
4
|
+
|
5
|
+
### Enhancement
|
6
|
+
|
7
|
+
* in_tcp: Add `send_keepalive_packet` option
|
8
|
+
https://github.com/fluent/fluentd/pull/3961
|
9
|
+
* buffer: backup broken file chunk
|
10
|
+
https://github.com/fluent/fluentd/pull/4025
|
11
|
+
* Add warning messages for restoring buffer with `flush_at_shutdown true`
|
12
|
+
https://github.com/fluent/fluentd/pull/4027
|
13
|
+
* Add logs for time period of restored buffer possibly broken
|
14
|
+
https://github.com/fluent/fluentd/pull/4028
|
15
|
+
|
16
|
+
### Bug Fix
|
17
|
+
|
18
|
+
* http_server_helper: Fix format of log messages originating from Async gem
|
19
|
+
https://github.com/fluent/fluentd/pull/3987
|
20
|
+
* Change to not generate a sigdump file after receiving a `SIGTERM` signal on
|
21
|
+
non-Windows
|
22
|
+
https://github.com/fluent/fluentd/pull/4034
|
23
|
+
https://github.com/fluent/fluentd/pull/4043
|
24
|
+
* out_forward: fix error of ack handling conflict on stopping with
|
25
|
+
`require_ack_response` enabled
|
26
|
+
https://github.com/fluent/fluentd/pull/4030
|
27
|
+
* Fix problem that some `system` configs are not reflected
|
28
|
+
https://github.com/fluent/fluentd/pull/4064
|
29
|
+
https://github.com/fluent/fluentd/pull/4065
|
30
|
+
https://github.com/fluent/fluentd/pull/4086
|
31
|
+
https://github.com/fluent/fluentd/pull/4090
|
32
|
+
https://github.com/fluent/fluentd/pull/4096
|
33
|
+
* Fix bug that the logger outputs some initial log messages without applying
|
34
|
+
some settings such as `format`
|
35
|
+
https://github.com/fluent/fluentd/pull/4091
|
36
|
+
* Windows: Fix a bug that the wrong log file is reopened with log rotate setting
|
37
|
+
when flushing or graceful reloading
|
38
|
+
https://github.com/fluent/fluentd/pull/4054
|
39
|
+
* Fix race condition of out_secondary_file
|
40
|
+
https://github.com/fluent/fluentd/pull/4081
|
41
|
+
* Suppress warning using different secondary for out_secondary_file
|
42
|
+
https://github.com/fluent/fluentd/pull/4087
|
43
|
+
* Fix value of `system_config.workers` at `run_configure`.
|
44
|
+
Change argument type of `Fluent::Plugin::Base::configure()` to
|
45
|
+
`Fluent::Config::Element` only.
|
46
|
+
https://github.com/fluent/fluentd/pull/4066
|
47
|
+
* Fix bug that Fluentd sometimes tries to use an unavailable port and fails to
|
48
|
+
start on Windows
|
49
|
+
https://github.com/fluent/fluentd/pull/4092
|
50
|
+
|
51
|
+
### Misc
|
52
|
+
|
53
|
+
* Add method for testing `filtered_with_time`
|
54
|
+
https://github.com/fluent/fluentd/pull/3899
|
55
|
+
* Replace `$$` with `Process.pid`
|
56
|
+
https://github.com/fluent/fluentd/pull/4040
|
57
|
+
* Relax required webric gem version
|
58
|
+
https://github.com/fluent/fluentd/pull/4061
|
59
|
+
* CI fixes to support Ruby 3.2
|
60
|
+
https://github.com/fluent/fluentd/pull/3968
|
61
|
+
https://github.com/fluent/fluentd/pull/3996
|
62
|
+
https://github.com/fluent/fluentd/pull/3997
|
63
|
+
* Other CI fixes
|
64
|
+
https://github.com/fluent/fluentd/pull/3969
|
65
|
+
https://github.com/fluent/fluentd/pull/3990
|
66
|
+
https://github.com/fluent/fluentd/pull/4013
|
67
|
+
https://github.com/fluent/fluentd/pull/4033
|
68
|
+
https://github.com/fluent/fluentd/pull/4044
|
69
|
+
https://github.com/fluent/fluentd/pull/4050
|
70
|
+
https://github.com/fluent/fluentd/pull/4062
|
71
|
+
https://github.com/fluent/fluentd/pull/4074
|
72
|
+
https://github.com/fluent/fluentd/pull/4082
|
73
|
+
https://github.com/fluent/fluentd/pull/4085
|
74
|
+
* Update MAINTAINERS.md
|
75
|
+
https://github.com/fluent/fluentd/pull/4026
|
76
|
+
https://github.com/fluent/fluentd/pull/4069
|
77
|
+
|
1
78
|
# v1.15
|
2
79
|
|
80
|
+
## Release v1.15.3 - 2022/11/02
|
81
|
+
|
82
|
+
### Bug Fix
|
83
|
+
|
84
|
+
* Support glob for `!include` directive in YAML config format
|
85
|
+
https://github.com/fluent/fluentd/pull/3917
|
86
|
+
* Remove meaningless oj options
|
87
|
+
https://github.com/fluent/fluentd/pull/3929
|
88
|
+
* Fix log initializer to correctly create per-process files on Windows
|
89
|
+
https://github.com/fluent/fluentd/pull/3939
|
90
|
+
* out_file: Fix the multi-worker check with `<worker 0-N>` directive
|
91
|
+
https://github.com/fluent/fluentd/pull/3942
|
92
|
+
|
93
|
+
### Misc
|
94
|
+
|
95
|
+
* Fix broken tests on Ruby 3.2
|
96
|
+
https://github.com/fluent/fluentd/pull/3883
|
97
|
+
https://github.com/fluent/fluentd/pull/3922
|
98
|
+
|
3
99
|
## Release v1.15.2 - 2022/08/22
|
4
100
|
|
5
101
|
### Enhancement
|
data/MAINTAINERS.md
CHANGED
@@ -5,7 +5,9 @@
|
|
5
5
|
- [Hiroshi Hatake](https://github.com/cosmo0920), [Calyptia](https://calyptia.com/)
|
6
6
|
- [Masahiro Nakagawa](https://github.com/repeatedly), [Treasure Data](https://www.treasuredata.com/)
|
7
7
|
- [Satoshi Tagomori](https://github.com/tagomoris), [Treasure Data](https://www.treasuredata.com/)
|
8
|
+
- [Toru Takahashi](https://github.com/toru-takahashi), [Treasure Data](https://www.treasuredata.com/)
|
8
9
|
- [Eduardo Silva](https://github.com/edsiper), [Calyptia](https://calyptia/)
|
9
10
|
- [Fujimoto Seiji](https://github.com/fujimots), [ClearCode](https://www.clear-code.com/)
|
10
11
|
- [Takuro Ashie](https://github.com/ashie), [ClearCode](https://www.clear-code.com/)
|
11
12
|
- [Kentaro Hayashi](https://github.com/kenhys), [ClearCode](https://www.clear-code.com/)
|
13
|
+
- [Daijiro Fukuda](https://github.com/daipom), [ClearCode](https://www.clear-code.com/)
|
data/README.md
CHANGED
@@ -4,7 +4,6 @@ Fluentd: Open-Source Log Collector
|
|
4
4
|
[![Testing on Ubuntu](https://github.com/fluent/fluentd/actions/workflows/linux-test.yaml/badge.svg?branch=master)](https://github.com/fluent/fluentd/actions/workflows/linux-test.yaml)
|
5
5
|
[![Testing on Windows](https://github.com/fluent/fluentd/actions/workflows/windows-test.yaml/badge.svg?branch=master)](https://github.com/fluent/fluentd/actions/workflows/windows-test.yaml)
|
6
6
|
[![Testing on macOS](https://github.com/fluent/fluentd/actions/workflows/macos-test.yaml/badge.svg?branch=master)](https://github.com/fluent/fluentd/actions/workflows/macos-test.yaml)
|
7
|
-
[![Testing on Arm64](https://cloud.drone.io/api/badges/fluent/fluentd/status.svg?branch=master)](https://cloud.drone.io/fluent/fluentd)
|
8
7
|
[![Code Climate](https://codeclimate.com/github/fluent/fluentd/badges/gpa.svg)](https://codeclimate.com/github/fluent/fluentd)
|
9
8
|
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1189/badge)](https://bestpractices.coreinfrastructure.org/projects/1189)
|
10
9
|
|
data/fluentd.gemspec
CHANGED
@@ -22,13 +22,13 @@ Gem::Specification.new do |gem|
|
|
22
22
|
gem.add_runtime_dependency("msgpack", [">= 1.3.1", "< 2.0.0"])
|
23
23
|
gem.add_runtime_dependency("yajl-ruby", ["~> 1.0"])
|
24
24
|
gem.add_runtime_dependency("cool.io", [">= 1.4.5", "< 2.0.0"])
|
25
|
-
gem.add_runtime_dependency("serverengine", [">= 2.3.
|
25
|
+
gem.add_runtime_dependency("serverengine", [">= 2.3.2", "< 3.0.0"])
|
26
26
|
gem.add_runtime_dependency("http_parser.rb", [">= 0.5.1", "< 0.9.0"])
|
27
27
|
gem.add_runtime_dependency("sigdump", ["~> 0.2.2"])
|
28
28
|
gem.add_runtime_dependency("tzinfo", [">= 1.0", "< 3.0"])
|
29
29
|
gem.add_runtime_dependency("tzinfo-data", ["~> 1.0"])
|
30
30
|
gem.add_runtime_dependency("strptime", [">= 0.2.4", "< 1.0.0"])
|
31
|
-
gem.add_runtime_dependency("webrick", ["
|
31
|
+
gem.add_runtime_dependency("webrick", ["~> 1.4"])
|
32
32
|
|
33
33
|
# build gem for a certain platform. see also Rakefile
|
34
34
|
fake_platform = ENV['GEM_BUILD_FAKE_PLATFORM'].to_s
|
@@ -26,26 +26,27 @@ $fluentdargv = Marshal.load(Marshal.dump(ARGV))
|
|
26
26
|
op = OptionParser.new
|
27
27
|
op.version = Fluent::VERSION
|
28
28
|
|
29
|
-
|
29
|
+
default_opts = Fluent::Supervisor.default_options
|
30
|
+
cmd_opts = {}
|
30
31
|
|
31
32
|
op.on('-s', "--setup [DIR=#{File.dirname(Fluent::DEFAULT_CONFIG_PATH)}]", "install sample configuration file to the directory") {|s|
|
32
|
-
|
33
|
+
cmd_opts[:setup_path] = s || File.dirname(Fluent::DEFAULT_CONFIG_PATH)
|
33
34
|
}
|
34
35
|
|
35
36
|
op.on('-c', '--config PATH', "config file path (default: #{Fluent::DEFAULT_CONFIG_PATH})") {|s|
|
36
|
-
|
37
|
+
cmd_opts[:config_path] = s
|
37
38
|
}
|
38
39
|
|
39
40
|
op.on('--dry-run', "Check fluentd setup is correct or not", TrueClass) {|b|
|
40
|
-
|
41
|
+
cmd_opts[:dry_run] = b
|
41
42
|
}
|
42
43
|
|
43
44
|
op.on('--show-plugin-config=PLUGIN', "[DEPRECATED] Show PLUGIN configuration and exit(ex: input:dummy)") {|plugin|
|
44
|
-
|
45
|
+
cmd_opts[:show_plugin_config] = plugin
|
45
46
|
}
|
46
47
|
|
47
48
|
op.on('-p', '--plugin DIR', "add plugin directory") {|s|
|
48
|
-
|
49
|
+
(cmd_opts[:plugin_dirs] ||= []) << s
|
49
50
|
}
|
50
51
|
|
51
52
|
op.on('-I PATH', "add library path") {|s|
|
@@ -53,48 +54,48 @@ op.on('-I PATH', "add library path") {|s|
|
|
53
54
|
}
|
54
55
|
|
55
56
|
op.on('-r NAME', "load library") {|s|
|
56
|
-
|
57
|
+
(cmd_opts[:libs] ||= []) << s
|
57
58
|
}
|
58
59
|
|
59
60
|
op.on('-d', '--daemon PIDFILE', "daemonize fluent process") {|s|
|
60
|
-
|
61
|
+
cmd_opts[:daemonize] = s
|
61
62
|
}
|
62
63
|
|
63
64
|
op.on('--under-supervisor', "run fluent worker under supervisor (this option is NOT for users)") {
|
64
|
-
|
65
|
+
cmd_opts[:supervise] = false
|
65
66
|
}
|
66
67
|
|
67
68
|
op.on('--no-supervisor', "run fluent worker without supervisor") {
|
68
|
-
|
69
|
-
|
69
|
+
cmd_opts[:supervise] = false
|
70
|
+
cmd_opts[:standalone_worker] = true
|
70
71
|
}
|
71
72
|
|
72
73
|
op.on('--workers NUM', "specify the number of workers under supervisor") { |i|
|
73
|
-
|
74
|
+
cmd_opts[:workers] = i.to_i
|
74
75
|
}
|
75
76
|
|
76
77
|
op.on('--user USER', "change user") {|s|
|
77
|
-
|
78
|
+
cmd_opts[:chuser] = s
|
78
79
|
}
|
79
80
|
|
80
81
|
op.on('--group GROUP', "change group") {|s|
|
81
|
-
|
82
|
+
cmd_opts[:chgroup] = s
|
82
83
|
}
|
83
84
|
|
84
85
|
op.on('--umask UMASK', "change umask") {|s|
|
85
|
-
|
86
|
+
cmd_opts[:chumask] = s
|
86
87
|
}
|
87
88
|
|
88
89
|
op.on('-o', '--log PATH', "log file path") {|s|
|
89
|
-
|
90
|
+
cmd_opts[:log_path] = s
|
90
91
|
}
|
91
92
|
|
92
93
|
op.on('--log-rotate-age AGE', 'generations to keep rotated log files') {|age|
|
93
94
|
if Fluent::Log::LOG_ROTATE_AGE.include?(age)
|
94
|
-
|
95
|
+
cmd_opts[:log_rotate_age] = age
|
95
96
|
else
|
96
97
|
begin
|
97
|
-
|
98
|
+
cmd_opts[:log_rotate_age] = Integer(age)
|
98
99
|
rescue TypeError, ArgumentError
|
99
100
|
usage "log-rotate-age should be #{ROTATE_AGE.join(', ')} or a number"
|
100
101
|
end
|
@@ -102,129 +103,129 @@ op.on('--log-rotate-age AGE', 'generations to keep rotated log files') {|age|
|
|
102
103
|
}
|
103
104
|
|
104
105
|
op.on('--log-rotate-size BYTES', 'sets the byte size to rotate log files') {|s|
|
105
|
-
|
106
|
+
cmd_opts[:log_rotate_size] = s.to_i
|
106
107
|
}
|
107
108
|
|
108
109
|
op.on('--log-event-verbose', 'enable log events during process startup/shutdown') {|b|
|
109
|
-
|
110
|
+
cmd_opts[:log_event_verbose] = b
|
110
111
|
}
|
111
112
|
|
112
113
|
op.on('-i', '--inline-config CONFIG_STRING', "inline config which is appended to the config file on-the-fly") {|s|
|
113
|
-
|
114
|
+
cmd_opts[:inline_config] = s
|
114
115
|
}
|
115
116
|
|
116
117
|
op.on('--emit-error-log-interval SECONDS', "suppress interval seconds of emit error logs") {|s|
|
117
|
-
|
118
|
+
cmd_opts[:suppress_interval] = s.to_i
|
118
119
|
}
|
119
120
|
|
120
121
|
op.on('--suppress-repeated-stacktrace [VALUE]', "suppress repeated stacktrace", TrueClass) {|b|
|
121
122
|
b = true if b.nil?
|
122
|
-
|
123
|
+
cmd_opts[:suppress_repeated_stacktrace] = b
|
123
124
|
}
|
124
125
|
|
125
126
|
op.on('--without-source', "invoke a fluentd without input plugins", TrueClass) {|b|
|
126
|
-
|
127
|
+
cmd_opts[:without_source] = b
|
127
128
|
}
|
128
129
|
|
129
130
|
op.on('--config-file-type VALU', 'guessing file type of fluentd configuration. yaml/yml or guess') { |s|
|
130
131
|
if (s == 'yaml') || (s == 'yml')
|
131
|
-
|
132
|
+
cmd_opts[:config_file_type] = s.to_sym
|
132
133
|
elsif (s == 'guess')
|
133
|
-
|
134
|
+
cmd_opts[:config_file_type] = s.to_sym
|
134
135
|
else
|
135
136
|
usage '--config-file-type accepts yaml/yml or guess'
|
136
137
|
end
|
137
138
|
}
|
138
139
|
|
139
140
|
op.on('--use-v1-config', "Use v1 configuration format (default)", TrueClass) {|b|
|
140
|
-
|
141
|
+
cmd_opts[:use_v1_config] = b
|
141
142
|
}
|
142
143
|
|
143
144
|
op.on('--use-v0-config', "Use v0 configuration format", TrueClass) {|b|
|
144
|
-
|
145
|
+
cmd_opts[:use_v1_config] = !b
|
145
146
|
}
|
146
147
|
|
147
148
|
op.on('--strict-config-value', "Parse config values strictly", TrueClass) {|b|
|
148
|
-
|
149
|
+
cmd_opts[:strict_config_value] = b
|
149
150
|
}
|
150
151
|
|
151
152
|
op.on('--enable-input-metrics', "Enable input plugin metrics on fluentd", TrueClass) {|b|
|
152
|
-
|
153
|
+
cmd_opts[:enable_input_metrics] = b
|
153
154
|
}
|
154
155
|
|
155
156
|
op.on('--enable-size-metrics', "Enable plugin record size metrics on fluentd", TrueClass) {|b|
|
156
|
-
|
157
|
+
cmd_opts[:enable_size_metrics] = b
|
157
158
|
}
|
158
159
|
|
159
160
|
op.on('-v', '--verbose', "increase verbose level (-v: debug, -vv: trace)", TrueClass) {|b|
|
160
|
-
|
161
|
-
|
162
|
-
|
161
|
+
return unless b
|
162
|
+
cur_level = cmd_opts.fetch(:log_level, default_opts[:log_level])
|
163
|
+
cmd_opts[:log_level] = [cur_level - 1, Fluent::Log::LEVEL_TRACE].max
|
163
164
|
}
|
164
165
|
|
165
166
|
op.on('-q', '--quiet', "decrease verbose level (-q: warn, -qq: error)", TrueClass) {|b|
|
166
|
-
|
167
|
-
|
168
|
-
|
167
|
+
return unless b
|
168
|
+
cur_level = cmd_opts.fetch(:log_level, default_opts[:log_level])
|
169
|
+
cmd_opts[:log_level] = [cur_level + 1, Fluent::Log::LEVEL_ERROR].min
|
169
170
|
}
|
170
171
|
|
171
172
|
op.on('--suppress-config-dump', "suppress config dumping when fluentd starts", TrueClass) {|b|
|
172
|
-
|
173
|
+
cmd_opts[:suppress_config_dump] = b
|
173
174
|
}
|
174
175
|
|
175
176
|
op.on('-g', '--gemfile GEMFILE', "Gemfile path") {|s|
|
176
|
-
|
177
|
+
cmd_opts[:gemfile] = s
|
177
178
|
}
|
178
179
|
|
179
180
|
op.on('-G', '--gem-path GEM_INSTALL_PATH', "Gemfile install path (default: $(dirname $gemfile)/vendor/bundle)") {|s|
|
180
|
-
|
181
|
+
cmd_opts[:gem_install_path] = s
|
181
182
|
}
|
182
183
|
|
183
184
|
op.on('--conf-encoding ENCODING', "specify configuration file encoding") { |s|
|
184
|
-
|
185
|
+
cmd_opts[:conf_encoding] = s
|
185
186
|
}
|
186
187
|
|
187
188
|
op.on('--disable-shared-socket', "Don't open shared socket for multiple workers") { |b|
|
188
|
-
|
189
|
+
cmd_opts[:disable_shared_socket] = b
|
189
190
|
}
|
190
191
|
|
191
192
|
if Fluent.windows?
|
192
|
-
|
193
|
+
cmd_opts.merge!(
|
193
194
|
:winsvc_name => 'fluentdwinsvc',
|
194
195
|
:winsvc_display_name => 'Fluentd Windows Service',
|
195
196
|
:winsvc_desc => 'Fluentd is an event collector system.',
|
196
197
|
)
|
197
198
|
|
198
199
|
op.on('-x', '--signame INTSIGNAME', "an object name which is used for Windows Service signal (Windows only)") {|s|
|
199
|
-
|
200
|
+
cmd_opts[:signame] = s
|
200
201
|
}
|
201
202
|
|
202
203
|
op.on('--reg-winsvc MODE', "install/uninstall as Windows Service. (i: install, u: uninstall) (Windows only)") {|s|
|
203
|
-
|
204
|
+
cmd_opts[:regwinsvc] = s
|
204
205
|
}
|
205
206
|
|
206
207
|
op.on('--[no-]reg-winsvc-auto-start', "Automatically start the Windows Service at boot. (only effective with '--reg-winsvc i') (Windows only)") {|s|
|
207
|
-
|
208
|
+
cmd_opts[:regwinsvcautostart] = s
|
208
209
|
}
|
209
210
|
|
210
211
|
op.on('--[no-]reg-winsvc-delay-start', "Automatically start the Windows Service at boot with delay. (only effective with '--reg-winsvc i' and '--reg-winsvc-auto-start') (Windows only)") {|s|
|
211
|
-
|
212
|
+
cmd_opts[:regwinsvcdelaystart] = s
|
212
213
|
}
|
213
214
|
|
214
215
|
op.on('--reg-winsvc-fluentdopt OPTION', "specify fluentd option parameters for Windows Service. (Windows only)") {|s|
|
215
|
-
|
216
|
+
cmd_opts[:fluentdopt] = s
|
216
217
|
}
|
217
218
|
|
218
219
|
op.on('--winsvc-name NAME', "The Windows Service name to run as (Windows only)") {|s|
|
219
|
-
|
220
|
+
cmd_opts[:winsvc_name] = s
|
220
221
|
}
|
221
222
|
|
222
223
|
op.on('--winsvc-display-name DISPLAY_NAME', "The Windows Service display name (Windows only)") {|s|
|
223
|
-
|
224
|
+
cmd_opts[:winsvc_display_name] = s
|
224
225
|
}
|
225
226
|
|
226
227
|
op.on('--winsvc-desc DESC', "The Windows Service description (Windows only)") {|s|
|
227
|
-
|
228
|
+
cmd_opts[:winsvc_desc] = s
|
228
229
|
}
|
229
230
|
end
|
230
231
|
|
@@ -247,6 +248,7 @@ rescue
|
|
247
248
|
usage $!.to_s
|
248
249
|
end
|
249
250
|
|
251
|
+
opts = default_opts.merge(cmd_opts)
|
250
252
|
|
251
253
|
##
|
252
254
|
## Bundler injection
|
@@ -345,18 +347,7 @@ end
|
|
345
347
|
exit 0 if early_exit
|
346
348
|
|
347
349
|
if opts[:supervise]
|
348
|
-
|
349
|
-
if opts[:log_path] && opts[:log_path] != "-"
|
350
|
-
if opts[:log_rotate_age] || opts[:log_rotate_size]
|
351
|
-
require 'pathname'
|
352
|
-
|
353
|
-
log_path = Pathname(opts[:log_path]).sub_ext("-supervisor#{Pathname(opts[:log_path]).extname}").to_s
|
354
|
-
opts[:log_path] = log_path
|
355
|
-
end
|
356
|
-
end
|
357
|
-
end
|
358
|
-
|
359
|
-
supervisor = Fluent::Supervisor.new(opts)
|
350
|
+
supervisor = Fluent::Supervisor.new(cmd_opts)
|
360
351
|
supervisor.configure(supervisor: true)
|
361
352
|
supervisor.run_supervisor(dry_run: opts[:dry_run])
|
362
353
|
else
|
@@ -364,7 +355,7 @@ else
|
|
364
355
|
puts "Error: multi workers is not supported with --no-supervisor"
|
365
356
|
exit 2
|
366
357
|
end
|
367
|
-
worker = Fluent::Supervisor.new(
|
358
|
+
worker = Fluent::Supervisor.new(cmd_opts)
|
368
359
|
worker.configure
|
369
360
|
|
370
361
|
if opts[:daemonize] && opts[:standalone_worker]
|
@@ -44,7 +44,7 @@ module Fluent
|
|
44
44
|
visitor = Visitor.new(scanner, class_loader)
|
45
45
|
|
46
46
|
visitor._register_domain(INCLUDE_TAG) do |_, val|
|
47
|
-
|
47
|
+
eval_include(Pathname.new(val), path.parent)
|
48
48
|
end
|
49
49
|
|
50
50
|
visitor._register_domain(FLUENT_JSON_TAG) do |_, val|
|
@@ -60,6 +60,23 @@ module Fluent
|
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
63
|
+
def eval_include(path, parent)
|
64
|
+
if path.relative?
|
65
|
+
pattern = parent.join(path)
|
66
|
+
else
|
67
|
+
pattern = path
|
68
|
+
end
|
69
|
+
result = []
|
70
|
+
Dir.glob(pattern).sort.each do |path|
|
71
|
+
result.concat(load(Pathname.new(path)))
|
72
|
+
end
|
73
|
+
result
|
74
|
+
rescue SystemCallError => e
|
75
|
+
parse_error = ConfigParseError.new("include error #{path} - #{e}")
|
76
|
+
parse_error.set_backtrace(e.backtrace)
|
77
|
+
raise parse_error
|
78
|
+
end
|
79
|
+
|
63
80
|
class Visitor < Psych::Visitors::ToRuby
|
64
81
|
def initialize(scanner, class_loader)
|
65
82
|
super(scanner, class_loader)
|
data/lib/fluent/daemon.rb
CHANGED
@@ -9,7 +9,5 @@ require 'fluent/supervisor'
|
|
9
9
|
|
10
10
|
server_module = Fluent.const_get(ARGV[0])
|
11
11
|
worker_module = Fluent.const_get(ARGV[1])
|
12
|
-
|
13
|
-
|
14
|
-
params = JSON.parse(ARGV[3])
|
15
|
-
ServerEngine::Daemon.run_server(server_module, worker_module) { Fluent::Supervisor.load_config(config_path, params) }
|
12
|
+
params = JSON.parse(ARGV[2])
|
13
|
+
ServerEngine::Daemon.run_server(server_module, worker_module) { Fluent::Supervisor.serverengine_config(params) }
|