3
0
Fork 0
forked from mirrors/nixpkgs

logstash service: make log verbosity configurable.

This commit is contained in:
Charles Strahan 2014-10-13 15:13:34 -04:00
parent 1a7c1615bf
commit dc2fac7c0c

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 {