Merge pull request #4506 from cstrahan/logstash-config

logstash service: make log verbosity configurable.
This commit is contained in:
lethalman 2014-10-26 20:10:03 +01:00
commit 40b5aa1d33

View File

@ -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 {