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;
|
pluginPath = lib.concatStringsSep ":" cfg.plugins;
|
||||||
havePluginPath = lib.length cfg.plugins > 0;
|
havePluginPath = lib.length cfg.plugins > 0;
|
||||||
ops = lib.optionalString;
|
ops = lib.optionalString;
|
||||||
|
verbosityFlag = {
|
||||||
|
debug = "--debug";
|
||||||
|
info = "--verbose";
|
||||||
|
warn = ""; # intentionally empty
|
||||||
|
error = "--quiet";
|
||||||
|
fatal = "--silent";
|
||||||
|
}."${cfg.logLevel}";
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
@ -37,6 +44,12 @@ in
|
|||||||
description = "The paths to find other logstash plugins 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 {
|
watchdogTimeout = mkOption {
|
||||||
type = types.int;
|
type = types.int;
|
||||||
default = 10;
|
default = 10;
|
||||||
@ -124,6 +137,7 @@ in
|
|||||||
"${cfg.package}/bin/logstash agent " +
|
"${cfg.package}/bin/logstash agent " +
|
||||||
"-w ${toString cfg.filterWorkers} " +
|
"-w ${toString cfg.filterWorkers} " +
|
||||||
ops havePluginPath "--pluginpath ${pluginPath} " +
|
ops havePluginPath "--pluginpath ${pluginPath} " +
|
||||||
|
"${verbosityFlag} " +
|
||||||
"--watchdog-timeout ${toString cfg.watchdogTimeout} " +
|
"--watchdog-timeout ${toString cfg.watchdogTimeout} " +
|
||||||
"-f ${writeText "logstash.conf" ''
|
"-f ${writeText "logstash.conf" ''
|
||||||
input {
|
input {
|
||||||
|
Loading…
Reference in New Issue
Block a user