Initialize logging earlier

slog_init() was called from server_start(), but this is kind of late
in the initialization. We should enable logging as soon as the config
is read.
master
Jessie Murray 1 year ago
parent 4350a051dd
commit c7b0e4a6b7
No known key found for this signature in database
GPG Key ID: E7E4D57EDDA744C5

@ -124,6 +124,9 @@ server_new(const char *cfg_file) {
s->log.fd = -1; s->log.fd = -1;
s->cfg = conf_read(cfg_file); s->cfg = conf_read(cfg_file);
/* initialize logging as soon as we've read the config file */
slog_init(s);
#ifdef HAVE_SSL #ifdef HAVE_SSL
if(s->cfg->ssl.enabled) { if(s->cfg->ssl.enabled) {
server_init_ssl(s); server_init_ssl(s);
@ -262,9 +265,6 @@ server_start(struct server *s) {
/* initialize libevent */ /* initialize libevent */
s->base = event_base_new(); s->base = event_base_new();
/* initialize logging before forking */
slog_init(s);
if(s->cfg->daemonize) { if(s->cfg->daemonize) {
server_daemonize(s, s->cfg->pidfile); server_daemonize(s, s->cfg->pidfile);

Loading…
Cancel
Save