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) ...@@ -190,6 +190,7 @@ CONF_Init(void)
config.log_file[0] = '\0'; config.log_file[0] = '\0';
config.varnish_bindump[0] = '\0'; config.varnish_bindump[0] = '\0';
config.syslog_facility = LOG_LOCAL0; config.syslog_facility = LOG_LOCAL0;
strcpy(config.syslog_facility_name, "LOCAL0");
config.monitor_interval = 30; config.monitor_interval = 30;
config.output_bufsiz = BUFSIZ; config.output_bufsiz = BUFSIZ;
...@@ -267,9 +268,8 @@ CONF_ReadFile(const char *file) { ...@@ -267,9 +268,8 @@ CONF_ReadFile(const char *file) {
} }
#define confdump(str,val) \ #define confdump(str,val) \
LOG_Log(LOG_DEBUG, "config: " str, (val)) LOG_Log(LOG_INFO, "config: " str, (val))
#if 0
void void
CONF_Dump(void) CONF_Dump(void)
{ {
...@@ -281,12 +281,20 @@ CONF_Dump(void) ...@@ -281,12 +281,20 @@ CONF_Dump(void)
confdump("output.file = %s", confdump("output.file = %s",
EMPTY(config.output_file) ? "stdout" : config.output_file); EMPTY(config.output_file) ? "stdout" : config.output_file);
confdump("append = %u", config.append); 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.facility = %s", config.syslog_facility_name);
confdump("syslog.ident = %s", config.syslog_ident);
confdump("monitor.interval = %u", config.monitor_interval); confdump("monitor.interval = %u", config.monitor_interval);
confdump("max.reclen = %u", config.max_reclen); confdump("max.reclen = %u", config.max_reclen);
confdump("max.headers = %u", config.max_headers); 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.fd = %u", config.max_fd);
confdump("max.data = %u", config.max_data); 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); confdump("user = %s", config.user_name);
} }
#endif
...@@ -178,6 +178,7 @@ HNDL_Abort(int sig) ...@@ -178,6 +178,7 @@ HNDL_Abort(int sig)
LOG_Log(LOG_ALERT, "Received signal %d (%s), stacktrace follows", sig, LOG_Log(LOG_ALERT, "Received signal %d (%s), stacktrace follows", sig,
strsignal(sig)); strsignal(sig));
stacktrace(); stacktrace();
CONF_Dump();
DATA_Dump(); DATA_Dump();
MON_Output(); MON_Output();
LOG_Log0(LOG_ALERT, "Aborting"); LOG_Log0(LOG_ALERT, "Aborting");
......
...@@ -496,6 +496,7 @@ static void ...@@ -496,6 +496,7 @@ static void
dump(int sig) dump(int sig)
{ {
(void) sig; (void) sig;
CONF_Dump();
DATA_Dump(); DATA_Dump();
} }
......
...@@ -185,9 +185,7 @@ void RDR_Stats(void); ...@@ -185,9 +185,7 @@ void RDR_Stats(void);
void CONF_Init(void); void CONF_Init(void);
int CONF_Add(const char *lval, const char *rval); int CONF_Add(const char *lval, const char *rval);
int CONF_ReadFile(const char *file); int CONF_ReadFile(const char *file);
#if 0
void CONF_Dump(void); void CONF_Dump(void);
#endif
/* log.c */ /* log.c */
#define EMPTY(s) (s[0] == '\0') #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