diff --git a/ChangeLog b/ChangeLog
index fb6b62297123d3a7ba5360cabfe9e5a615a11334..12c143633e65f6148cdf2cb29c0c37ec1b1e7392 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,7 @@ version 0.9.7 -- UNRELEASED
 	   "info" are included in the report e-mail (closes #563734)
 	 . reportspace: skip non-directories and places that don't exist on the
 	   local filesystem (Closes: #536049)
+	 . set BACKUPNINJA_DEBUG when invoked with -d (Closes: #537266)
     lib changes
 	easydialog:
 	 . Allow form fields input to grow up to 100 chars (Closes: #562249)
diff --git a/src/backupninja.in b/src/backupninja.in
index c3ec7edc6d1f376108320069b9e85f119317b218..e8a820ff562aa43b21f2bce94526b7d726a0afcf 100755
--- a/src/backupninja.in
+++ b/src/backupninja.in
@@ -381,7 +381,7 @@ loglevel=3
 while [ $# -ge 1 ]; do
    case $1 in
       -h|--help) usage;;
-      -d|--debug) debug=1;;
+      -d|--debug) debug=1; export BACKUPNINJA_DEBUG=yes;;
       -t|--test) test=1;debug=1;;
       -n|--now) processnow=1;;
       -f|--conffile)