commit 26df50981fe18b5f244293b203c1a1eb30759554 from: Omar Polo date: Thu Aug 03 22:37:34 2023 UTC actually use the specified log style commit - 56054fe197b01c5e4e2ee433c752fcec79a09fd3 commit + 26df50981fe18b5f244293b203c1a1eb30759554 blob - 6b4accb6b4afa887a1560e3be29c8a28b622c449 blob + e5ce62f8d2d669eb90b444332ef396b636059960 --- config.c +++ config.c @@ -65,10 +65,11 @@ config_purge(struct conf *conf) struct alist *a, *ta; struct pki *pki, *tpki; struct address *addr, *taddr; - int use_privsep_crypto; + int use_privsep_crypto, log_format; ps = conf->ps; use_privsep_crypto = conf->use_privsep_crypto; + log_format = conf->log_format; free(conf->log_access); free_mime(&conf->mime); @@ -150,6 +151,7 @@ config_purge(struct conf *conf) conf->use_privsep_crypto = use_privsep_crypto; conf->protos = TLS_PROTOCOL_TLSv1_2 | TLS_PROTOCOL_TLSv1_3; conf->log_syslog = 1; + conf->log_format = log_format; init_mime(&conf->mime); TAILQ_INIT(&conf->fcgi); TAILQ_INIT(&conf->hosts); @@ -289,6 +291,10 @@ config_send(struct conf *conf) struct alist *a; size_t i; + if (proc_compose(ps, PROC_SERVER, IMSG_RECONF_LOG_FMT, + &conf->log_format, sizeof(conf->log_format)) == -1) + return -1; + for (i = 0; i < conf->mime.len; ++i) { m = &conf->mime.t[i]; if (proc_compose(ps, PROC_SERVER, IMSG_RECONF_MIME, @@ -526,6 +532,11 @@ config_recv(struct conf *conf, struct imsg *imsg) config_purge(conf); h = NULL; p = NULL; + break; + + case IMSG_RECONF_LOG_FMT: + IMSG_SIZE_CHECK(imsg, &conf->log_format); + memcpy(&conf->log_format, imsg->data, datalen); break; case IMSG_RECONF_MIME: blob - 09291694acc16f7c430ff1e9c066dd7eb8689f3d blob + 658f961a0e2727e1cc33a35015a89b666e677564 --- gmid.c +++ gmid.c @@ -125,6 +125,8 @@ log_request(struct client *c, int code, const char *me t = ""; strlcpy(b, t, sizeof(b)); } + + log_warnx("log format is %d", conf->log_format); switch (conf->log_format) { case LOG_FORMAT_LEGACY: blob - 16935cad5c0d0d07b1fcd0b004fcfc24ff4b7a97 blob + 0ff9f6b47acd247834136d1fb386f7932d48a2d1 --- gmid.h +++ gmid.h @@ -334,6 +334,7 @@ enum imsg_type { IMSG_LOG_SYSLOG, IMSG_RECONF_START, + IMSG_RECONF_LOG_FMT, IMSG_RECONF_MIME, IMSG_RECONF_PROTOS, IMSG_RECONF_SOCK, blob - 3bceac609b9db524b8bfe314dee04b63d2562061 blob + 0fcb49a8d31f2ed33209798266d57cf5a067a44d --- server.c +++ server.c @@ -1501,6 +1501,7 @@ server_dispatch_parent(int fd, struct privsep_proc *p, switch (imsg->hdr.type) { case IMSG_RECONF_START: + case IMSG_RECONF_LOG_FMT: case IMSG_RECONF_MIME: case IMSG_RECONF_PROTOS: case IMSG_RECONF_SOCK: