[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] service: Honor #:log-file in make-forkexec-constructor.
From: |
Danny Milosavljevic |
Subject: |
Re: [PATCH] service: Honor #:log-file in make-forkexec-constructor. |
Date: |
Tue, 6 Sep 2016 21:13:32 +0200 |
On Tue, 6 Sep 2016 14:36:35 +0200
David Craven <address@hidden> wrote:
> Not syslog, but helps with debugging...
That definitely helps - however, in the long run, I think that using syslog is
better. Syslog does the splitting up in different files (or not) and onto
different machines (or not), filtering (or not), log rotation etc. So it makes
sense to make services use syslog instead of rolling-your-own filtering,
splitting, networking etcetc 267843 times. That said the services should just
use syslog on their own - we could only guess when a new log message starts.
I checked out the syslog wire format - it's not difficult. The only thing to
keep in mind is that the local sockets wants a NUL terminator (if it's a stream
socket) but a network node doesn't (makes sense - the network thing is UDP
packets and the message is just one packet long). I think always including it
doesn't hurt.
The prefix is (facility << 3) | priority in angle brackets.
https://www.gnu.org/software/anubis/manual/html_section/anubis_11.html seems to
already support syslog, maybe we can copy it from there.
https://netkiller.github.io/python/library/syslog.html small public domain
implementation of syslog client in Python.
https://tools.ietf.org/html/rfc5424#section-6.1 lists message length limits.
Or we could pipe the output to "logger" from inetutils.