summary refs log tree commit diff
path: root/nixos/modules/services/logging/logstash.nix
diff options
context:
space:
mode:
authorCharles Strahan <charles.c.strahan@gmail.com>2014-10-13 15:13:34 -0400
committerCharles Strahan <charles.c.strahan@gmail.com>2014-10-13 15:48:41 -0400
commitdc2fac7c0cbdbe11c074496baefc4075ef13210a (patch)
tree3dad39c45fb48a6fd880e0d30101a33502f0abaf /nixos/modules/services/logging/logstash.nix
parent1a7c1615bf580c247f1ae1202d0705187e6d18bb (diff)
downloadnixpkgs-dc2fac7c0cbdbe11c074496baefc4075ef13210a.tar
nixpkgs-dc2fac7c0cbdbe11c074496baefc4075ef13210a.tar.gz
nixpkgs-dc2fac7c0cbdbe11c074496baefc4075ef13210a.tar.bz2
nixpkgs-dc2fac7c0cbdbe11c074496baefc4075ef13210a.tar.lz
nixpkgs-dc2fac7c0cbdbe11c074496baefc4075ef13210a.tar.xz
nixpkgs-dc2fac7c0cbdbe11c074496baefc4075ef13210a.tar.zst
nixpkgs-dc2fac7c0cbdbe11c074496baefc4075ef13210a.zip
logstash service: make log verbosity configurable.
Diffstat (limited to 'nixos/modules/services/logging/logstash.nix')
-rw-r--r--nixos/modules/services/logging/logstash.nix14
1 files changed, 14 insertions, 0 deletions
diff --git a/nixos/modules/services/logging/logstash.nix b/nixos/modules/services/logging/logstash.nix
index 41f71be2365..117ee1c900f 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 {