role logging_args method, use in app

This commit is contained in:
Nick Lozon
2023-11-22 13:28:21 -05:00
parent f9a934a01f
commit 788a57e85e
2 changed files with 13 additions and 1 deletions

View File

@@ -21,7 +21,7 @@ class Kamal::Commands::App < Kamal::Commands::Base
"-e", "KAMAL_VERSION=\"#{config.version}\"",
*role_config.env_args,
*role_config.health_check_args,
*config.logging_args,
*role_config.logging_args,
*config.volume_args,
*role_config.asset_volume_args,
*role_config.label_args,

View File

@@ -36,6 +36,18 @@ class Kamal::Configuration::Role
argumentize "--label", labels
end
def logging_args
args = config.logging || {}
args.deep_merge!(specializations['logging']) if specializations['logging'].present?
if args.any?
optionize({ "log-driver" => args["driver"] }.compact) +
argumentize("--log-opt", args["options"])
else
config.logging_args
end
end
def env
if config.env && config.env["secret"]