diff options
author | Charles Strahan <charles.c.strahan@gmail.com> | 2014-10-13 15:13:34 -0400 |
---|---|---|
committer | Charles Strahan <charles.c.strahan@gmail.com> | 2014-10-13 15:48:41 -0400 |
commit | dc2fac7c0cbdbe11c074496baefc4075ef13210a (patch) | |
tree | 3dad39c45fb48a6fd880e0d30101a33502f0abaf /nixos/modules | |
parent | 1a7c1615bf580c247f1ae1202d0705187e6d18bb (diff) | |
download | nixlib-dc2fac7c0cbdbe11c074496baefc4075ef13210a.tar nixlib-dc2fac7c0cbdbe11c074496baefc4075ef13210a.tar.gz nixlib-dc2fac7c0cbdbe11c074496baefc4075ef13210a.tar.bz2 nixlib-dc2fac7c0cbdbe11c074496baefc4075ef13210a.tar.lz nixlib-dc2fac7c0cbdbe11c074496baefc4075ef13210a.tar.xz nixlib-dc2fac7c0cbdbe11c074496baefc4075ef13210a.tar.zst nixlib-dc2fac7c0cbdbe11c074496baefc4075ef13210a.zip |
logstash service: make log verbosity configurable.
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/services/logging/logstash.nix | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/nixos/modules/services/logging/logstash.nix b/nixos/modules/services/logging/logstash.nix index 41f71be2365c..117ee1c900f5 100644 --- a/nixos/modules/services/logging/logstash.nix +++ b/nixos/modules/services/logging/logstash.nix @@ -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 { |