From 42435bf0643f1380f2e8135c994449be25e7b21d Mon Sep 17 00:00:00 2001 From: Shizuo Fujita Date: Tue, 26 Nov 2024 14:22:43 +0900 Subject: [PATCH] daemon: setup global logger on Windows Signed-off-by: Shizuo Fujita --- fluentd.pid | 1 + lib/fluent/daemon.rb | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 fluentd.pid diff --git a/fluentd.pid b/fluentd.pid new file mode 100644 index 0000000000..6fd72932ec --- /dev/null +++ b/fluentd.pid @@ -0,0 +1 @@ +23784 diff --git a/lib/fluent/daemon.rb b/lib/fluent/daemon.rb index 628900c4b6..97a2c29b21 100644 --- a/lib/fluent/daemon.rb +++ b/lib/fluent/daemon.rb @@ -10,4 +10,23 @@ server_module = Fluent.const_get(ARGV[0]) worker_module = Fluent.const_get(ARGV[1]) params = JSON.parse(ARGV[2]) + +# Invoke Fluent::Supervisor#configure to setup global logger +opts = { + daemonize: params["daemonize"], + inline_config: params["inline_config"], + config_path: params["fluentd_conf_path"], + conf_encoding: params["conf_encoding"], + config_file_type: params["config_file_type"].to_sym, + log_path: params["log_path"], + log_rotate_age: params["log_rotate_age"], + log_rotate_size: params["log_rotate_size"], + log_level: params["log_level"], + use_v1_config: params["use_v1_config"], + chuser: params["chuser"], + chgroup: params["chgroup"], +} +server = Fluent::Supervisor.new(opts) +server.configure + ServerEngine::Daemon.run_server(server_module, worker_module) { Fluent::Supervisor.serverengine_config(params) }