From mboxrd@z Thu Jan 1 00:00:00 1970 From: Danny Milosavljevic Subject: Re: [PATCH] service: Honor #:log-file in make-forkexec-constructor. Date: Tue, 6 Sep 2016 21:13:32 +0200 Message-ID: <20160906211332.46c690db@scratchpost.org> References: <878tv6uk0v.fsf@gnu.org> <20160906123536.1321-1-david@craven.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47174) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhLoU-0005Ov-Ge for guix-devel@gnu.org; Tue, 06 Sep 2016 15:13:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bhLoQ-0006Ne-8c for guix-devel@gnu.org; Tue, 06 Sep 2016 15:13:41 -0400 Received: from dd1012.kasserver.com ([85.13.128.8]:47356) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhLoQ-0006MJ-1a for guix-devel@gnu.org; Tue, 06 Sep 2016 15:13:38 -0400 In-Reply-To: List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: David Craven Cc: guix-devel On Tue, 6 Sep 2016 14:36:35 +0200 David Craven 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.