commit - cba01a868748013f838c28ad8005c8377160c76f
commit + 46bcc4ea95b03fe81ad361ee02bd021a7618e5a9
blob - 753bb7267b7a86e0c7c8568d4f0cc2c0892f5a9e
blob + 6b4accb6b4afa887a1560e3be29c8a28b622c449
--- config.c
+++ config.c
init_mime(&conf->mime);
conf->prefork = 3;
+ conf->log_syslog = 1;
#ifdef __OpenBSD__
conf->use_privsep_crypto = 1;
conf->ps = ps;
conf->use_privsep_crypto = use_privsep_crypto;
conf->protos = TLS_PROTOCOL_TLSv1_2 | TLS_PROTOCOL_TLSv1_3;
+ conf->log_syslog = 1;
init_mime(&conf->mime);
TAILQ_INIT(&conf->fcgi);
TAILQ_INIT(&conf->hosts);
blob - 472a3e061effc2afdf379b649add052c847737e6
blob + 8f0fd3772518670fde0e69fd2d14f271916eff53
--- gmid.c
+++ gmid.c
if (proc_compose_imsg(ps, PROC_LOGGER, -1, IMSG_LOG_ACCESS, -1, fd,
NULL, 0) == -1)
return -1;
+ if (proc_compose_imsg(ps, PROC_LOGGER, -1, IMSG_LOG_SYSLOG, -1, -1,
+ &conf->log_syslog, sizeof(conf->log_syslog)) == -1)
+ return -1;
return 0;
}
blob - 58999ba28be31ff75d8b30d617c2dcf37e0ebb77
blob + ebbbc275ad1cb9979a4dd5498c946b62770ea957
--- gmid.conf.5
+++ gmid.conf.5
Multiple options may be provided within curly braces.
The available options are as follows:
.Bl -tag -width Ds
-.It Ic syslog
+.It Ic syslog Op Ic off
Log to syslog.
-This is the default behaviour.
+It is enabled by default, use the
+.Ic off
+argument to disable.
.It Ic access Ar file
Log the requests to
.Ar file .
blob - 8616099a0fab1f74423a11e75f88814b89c77053
blob + 16935cad5c0d0d07b1fcd0b004fcfc24ff4b7a97
--- gmid.h
+++ gmid.h
char user[LOGIN_NAME_MAX];
int prefork;
int reload;
+ int log_syslog;
char *log_access;
enum log_format log_format;
int use_privsep_crypto;
enum imsg_type {
IMSG_LOG_REQUEST,
IMSG_LOG_ACCESS,
+ IMSG_LOG_SYSLOG,
IMSG_RECONF_START,
IMSG_RECONF_MIME,
blob - 4de68c01d8f6bc7f7ce2d464bc80def0e85b7067
blob + d0e25c9daab970a58ac13056b4a90ae85fc6f801
--- logger.c
+++ logger.c
#endif
static int logfd = -1;
+static int log_to_syslog = 1;
static void logger_init(struct privsep *, struct privsep_proc *, void *);
static void logger_shutdown(void);
logger_dispatch_parent(int fd, struct privsep_proc *p, struct imsg *imsg)
{
switch (imsg->hdr.type) {
+ case IMSG_LOG_SYSLOG:
+ if (IMSG_DATA_SIZE(imsg) != sizeof(log_to_syslog))
+ fatal("corrupted IMSG_LOG_SYSLOG");
+ memcpy(&log_to_syslog, imsg->data, sizeof(log_to_syslog));
+ break;
case IMSG_LOG_ACCESS:
if (logfd != -1)
close(logfd);
msg[datalen - 1] = '\0';
if (logfd != -1)
dprintf(logfd, "%s\n", msg);
- else
+ if (log_to_syslog)
syslog(LOG_DAEMON | LOG_NOTICE, "%s", msg);
break;
default:
blob - 83d0858f36500ebdcf7b9bd1b1dc3415eeccea8f
blob + a47f1f1789a9afdf97fa0db532984f67e2f7f191
--- parse.y
+++ parse.y
| logopts logopt optnl
;
-logopt : SYSLOG {
- free(conf->log_access);
- conf->log_access = NULL;
+logopt : SYSLOG OFF {
+ conf->log_syslog = 0;
}
+ | SYSLOG {
+ conf->log_syslog = 1;
+ }
| ACCESS string {
free(conf->log_access);
conf->log_access = $2;