Commit 8a1ca837 authored by Geoff Simmons's avatar Geoff Simmons

varnishevent: dump the config to log on USR1 and ABRT signals

parent c00004d2
......@@ -190,6 +190,7 @@ CONF_Init(void)
config.log_file[0] = '\0';
config.varnish_bindump[0] = '\0';
config.syslog_facility = LOG_LOCAL0;
strcpy(config.syslog_facility_name, "LOCAL0");
config.monitor_interval = 30;
config.output_bufsiz = BUFSIZ;
......@@ -267,9 +268,8 @@ CONF_ReadFile(const char *file) {
}
#define confdump(str,val) \
LOG_Log(LOG_DEBUG, "config: " str, (val))
LOG_Log(LOG_INFO, "config: " str, (val))
#if 0
void
CONF_Dump(void)
{
......@@ -281,12 +281,20 @@ CONF_Dump(void)
confdump("output.file = %s",
EMPTY(config.output_file) ? "stdout" : config.output_file);
confdump("append = %u", config.append);
confdump("cformat = %s", config.cformat);
confdump("bformat = %s", config.bformat);
confdump("zformat = %s", config.zformat);
confdump("syslog.facility = %s", config.syslog_facility_name);
confdump("syslog.ident = %s", config.syslog_ident);
confdump("monitor.interval = %u", config.monitor_interval);
confdump("max.reclen = %u", config.max_reclen);
confdump("max.headers = %u", config.max_headers);
confdump("max.vcl_log = %u", config.max_vcl_log);
confdump("max.vcl_call = %u", config.max_vcl_call);
confdump("max.fd = %u", config.max_fd);
confdump("max.data = %u", config.max_data);
confdump("housekeep.interval = %u", config.housekeep_interval);
confdump("ttl = %u", config.ttl);
confdump("output.bufsiz = %u", config.output_bufsiz);
confdump("user = %s", config.user_name);
}
#endif
......@@ -178,6 +178,7 @@ HNDL_Abort(int sig)
LOG_Log(LOG_ALERT, "Received signal %d (%s), stacktrace follows", sig,
strsignal(sig));
stacktrace();
CONF_Dump();
DATA_Dump();
MON_Output();
LOG_Log0(LOG_ALERT, "Aborting");
......
......@@ -496,6 +496,7 @@ static void
dump(int sig)
{
(void) sig;
CONF_Dump();
DATA_Dump();
}
......
......@@ -185,9 +185,7 @@ void RDR_Stats(void);
void CONF_Init(void);
int CONF_Add(const char *lval, const char *rval);
int CONF_ReadFile(const char *file);
#if 0
void CONF_Dump(void);
#endif
/* log.c */
#define EMPTY(s) (s[0] == '\0')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment