Merge pull request #4506 from cstrahan/logstash-config
logstash service: make log verbosity configurable.
This commit is contained in:
commit
40b5aa1d33
@ -7,6 +7,13 @@ let
|
||||
pluginPath = lib.concatStringsSep ":" cfg.plugins;
|
||||
havePluginPath = lib.length cfg.plugins > 0;
|
||||
ops = lib.optionalString;
|
||||
verbosityFlag = {
|
||||
debug = "--debug";
|
||||
info = "--verbose";
|
||||
warn = ""; # intentionally empty
|
||||
error = "--quiet";
|
||||
fatal = "--silent";
|
||||
}."${cfg.logLevel}";
|
||||
|
||||
in
|
||||
|
||||
@ -37,6 +44,12 @@ in
|
||||
description = "The paths to find other logstash plugins in.";
|
||||
};
|
||||
|
||||
logLevel = mkOption {
|
||||
type = types.enum [ "debug" "info" "warn" "error" "fatal" ];
|
||||
default = "warn";
|
||||
description = "Logging verbosity level.";
|
||||
};
|
||||
|
||||
watchdogTimeout = mkOption {
|
||||
type = types.int;
|
||||
default = 10;
|
||||
@ -124,6 +137,7 @@ in
|
||||
"${cfg.package}/bin/logstash agent " +
|
||||
"-w ${toString cfg.filterWorkers} " +
|
||||
ops havePluginPath "--pluginpath ${pluginPath} " +
|
||||
"${verbosityFlag} " +
|
||||
"--watchdog-timeout ${toString cfg.watchdogTimeout} " +
|
||||
"-f ${writeText "logstash.conf" ''
|
||||
input {
|
||||
|
Loading…
Reference in New Issue
Block a user