summaryrefslogtreecommitdiffstats
path: root/runtime/debug.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-11-10 12:50:48 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2009-11-10 12:50:48 +0100
commit2b5e15d549940c7ace9017eaf40d523e3741c9a2 (patch)
treebc22cdc468329ab9996c0b8b1bc68348e0160149 /runtime/debug.c
parent224c3aef8b4d3d95ab2100c3056f2f92c130b220 (diff)
downloadrsyslog-2b5e15d549940c7ace9017eaf40d523e3741c9a2.tar.gz
rsyslog-2b5e15d549940c7ace9017eaf40d523e3741c9a2.tar.xz
rsyslog-2b5e15d549940c7ace9017eaf40d523e3741c9a2.zip
added a so-called "On Demand Debug" mode
in which debug output can be generated only after the process has started, but not right from the beginning. This is assumed to be useful for hard-to-find bugs. Also improved the doc on the debug system.
Diffstat (limited to 'runtime/debug.c')
-rw-r--r--runtime/debug.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/runtime/debug.c b/runtime/debug.c
index 1b592ef3..9547eee6 100644
--- a/runtime/debug.c
+++ b/runtime/debug.c
@@ -51,6 +51,7 @@
#include "rsyslog.h"
#include "debug.h"
#include "atomic.h"
+#include "cfsysline.h"
#include "obj.h"
@@ -1263,6 +1264,7 @@ dbgGetRuntimeOptions(void)
"NoLogTimestamp\n"
"Nostdoout\n"
"filetrace=file (may be provided multiple times)\n"
+ "DebugOnDemand - enables debugging on USR1, but does not turn on output\n"
"\nSee debug.html in your doc set or http://www.rsyslog.com for details\n");
exit(1);
} else if(!strcasecmp((char*)optname, "debug")) {
@@ -1271,6 +1273,13 @@ dbgGetRuntimeOptions(void)
*/
Debug = 1;
debugging_on = 1;
+ } else if(!strcasecmp((char*)optname, "debugondemand")) {
+ /* Enables debugging, but turns off debug output */
+ Debug = 1;
+ debugging_on = 1;
+ dbgprintf("Note: debug on demand turned on via configuraton file, "
+ "use USR1 signal to activate.\n");
+ debugging_on = 0;
} else if(!strcasecmp((char*)optname, "logfuncflow")) {
bLogFuncFlow = 1;
} else if(!strcasecmp((char*)optname, "logallocfree")) {