diff options
author | lethalman <lucabru@src.gnome.org> | 2014-10-26 20:10:03 +0100 |
---|---|---|
committer | lethalman <lucabru@src.gnome.org> | 2014-10-26 20:10:03 +0100 |
commit | 40b5aa1d336bdc13cc5a945b961cb4e47f3c3da7 (patch) | |
tree | 852ace95b58bd7e2131b8639231c3748746a92a4 /nixos/modules | |
parent | 401c84f75c9fae9b45e347f3dc5943b7f779525a (diff) | |
parent | dc2fac7c0cbdbe11c074496baefc4075ef13210a (diff) | |
download | nixlib-40b5aa1d336bdc13cc5a945b961cb4e47f3c3da7.tar nixlib-40b5aa1d336bdc13cc5a945b961cb4e47f3c3da7.tar.gz nixlib-40b5aa1d336bdc13cc5a945b961cb4e47f3c3da7.tar.bz2 nixlib-40b5aa1d336bdc13cc5a945b961cb4e47f3c3da7.tar.lz nixlib-40b5aa1d336bdc13cc5a945b961cb4e47f3c3da7.tar.xz nixlib-40b5aa1d336bdc13cc5a945b961cb4e47f3c3da7.tar.zst nixlib-40b5aa1d336bdc13cc5a945b961cb4e47f3c3da7.zip |
Merge pull request #4506 from cstrahan/logstash-config
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 { |