diff --git a/lib/cli.py b/lib/cli.py
index 523cab7b6ff38037480bb7cee45c3509e9bce965..02837757ec41513d78b4b89cbc72b8f3aac6d176 100644
--- a/lib/cli.py
+++ b/lib/cli.py
@@ -483,9 +483,8 @@ cli_option = CliOption
 _YESNO = ("yes", "no")
 _YORNO = "yes|no"
 
-DEBUG_OPT = cli_option("-d", "--debug", default=False,
-                       action="store_true",
-                       help="Turn debugging on")
+DEBUG_OPT = cli_option("-d", "--debug", default=0, action="count",
+                       help="Increase debugging level")
 
 NOHDR_OPT = cli_option("--no-headers", default=False,
                        action="store_true", dest="no_headers",
diff --git a/lib/utils.py b/lib/utils.py
index 45f0ecdb5b3978f379f68d41523681290843285c..77ab938959b3a8a59569c708db5359888bee007f 100644
--- a/lib/utils.py
+++ b/lib/utils.py
@@ -1762,14 +1762,14 @@ def GetDaemonPort(daemon_name):
   return port
 
 
-def SetupLogging(logfile, debug=False, stderr_logging=False, program="",
+def SetupLogging(logfile, debug=0, stderr_logging=False, program="",
                  multithreaded=False, syslog=constants.SYSLOG_USAGE):
   """Configures the logging module.
 
   @type logfile: str
   @param logfile: the filename to which we should log
-  @type debug: boolean
-  @param debug: whether to enable debug messages too or
+  @type debug: integer
+  @param debug: if greater than zero, enable debug messages, otherwise
       only those at C{INFO} and above level
   @type stderr_logging: boolean
   @param stderr_logging: whether we should also log to the standard error