aboutsummaryrefslogtreecommitdiff
path: root/log.c
AgeCommit message (Collapse)Author
2023-06-06add missing include of gmid.hOmar Polo
2023-06-06switch to the more usual log.cOmar Polo
2023-06-06rename log.[ch] to logger.[ch]Omar Polo
2023-06-05fix off-by-one in recent fatal changeOmar Polo
2023-06-05provide a more usual fatalOmar Polo
fatal usually appends the error string. Add 'fatalx' that doesn't. Fix callers and move the prototypes to log.h
2022-07-07call tzset(3) to fix times in logsOmar Polo
reported by Karl Jeacle, thanks!
2021-10-24fix "double slash" in logsOmar Polo
gmid ended up printing two slashes between the hostname and the path when logging the request IRI.
2021-10-15c->req may be NULL nowOmar Polo
2021-10-02verbose logging for getnameinfoOmar Polo
2021-09-17fix syslog logging on FreeBSDOmar Polo
Due to capsicum(4), opening the log on-demand via syslog(3) fails. openlog(LOG_NDELAY) forces the log to be opened immediately, before we enter capsicum. This doesn't affect OpenBSD (where pledge(2) doesn't stop syslog) nor linux (where the log process is not sandboxed.) Reported by Karl Jeacle, thank you!
2021-08-23fix wrong arguments order for send_logOmar Polo
2021-07-19introduce IMSG_LOG_REQUESTOmar Polo
2021-07-19send_log: accept explicit imsg type paramOmar Polo
2021-07-07initialize the logger earlyOmar Polo
Initialize the logger as soon as possible and log by default to stderr. With this, some (common?) errors are printed early instead of ending up in syslog. # NB: this is in configless mode % ./gmid -p 80 [2021-07-07 11:05:57] bind: Address already in use % ./gmid -p 81 [2021-07-07 11:13:53] bind: Permission denied %
2021-07-06fmtOmar Polo
2021-06-16kill unused variableOmar Polo
leftover from the handle_imsg_log -> do_log transition.
2021-06-15allow sending fd to log on to the logger processOmar Polo
the logger process now can receive a file descriptor to write logs to. At the moment the logic is simple, if it receives a file it logs there, otherwise it logs to syslog. This will allow to log on custom log files.
2021-04-28wait for logger after fatal()Omar Polo
With -f, when the main process exits after a fatal() (usually) the shell prompt is printed before the logger message. This adds a small poll to wait for the logger process to exit.
2021-04-28fatal: send log to loggerOmar Polo
2021-04-28send priority to the logger processOmar Polo
2021-04-28lower log priority for fatal errors from CRIT to ERROmar Polo
found by Anna, thanks!
2021-04-14print the datetime when logging to stderrOmar Polo
2021-03-20move all sandbox-related code to sandbox.cOmar Polo
while there, add capsicum for the logger process
2021-03-19refactoring: imsg everywhereOmar Polo
use imsg to handle ALL kinds of IPC in gmid. This simplifies and shorten the code, and makes everything more uniform too.
2021-03-03fix out-of-bounds accessOmar Polo
obviously msg[datalen] is an off-by-one
2021-02-23move log_init & vars to gmid.c, retain logger_main in log.cOmar Polo
this is to let the regression suite compile
2021-02-23move vhost_should_log call to server.cOmar Polo
log.o is linked to some regress/ stuff. Calling from there a vhost_* function means that we should link the regress/stuff to server.o too (and that would pull in other stuff...). Moving the call is easier, and also probably better.
2021-02-23add `log on/off' to enable/disable logs per-locationOmar Polo
2021-02-23don't directly include sys/queue.hOmar Polo
2021-02-23tests and compat for imsgOmar Polo
2021-02-23moving logging to its own processOmar Polo
2021-02-12fix various compilation errorsOmar Polo
Include gmid.h as first header in every file, as it then includes config.h (that defines _GNU_SOURCE for instance). Fix also a warning about unsigned vs signed const char pointers in openssl.
2021-02-07move logging code to log.cOmar Polo