Skip to content

Commit

Permalink
daemon: setup global logger on Windows
Browse files Browse the repository at this point in the history
Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
  • Loading branch information
Watson1978 committed Nov 26, 2024
1 parent 89f0a76 commit 42435bf
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions fluentd.pid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
23784
19 changes: 19 additions & 0 deletions lib/fluent/daemon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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) }

0 comments on commit 42435bf

Please sign in to comment.