From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 27400 invoked from network); 25 Oct 2022 16:41:31 -0000 Received: from alyss.skarnet.org (95.142.172.232) by inbox.vuxu.org with ESMTPUTF8; 25 Oct 2022 16:41:31 -0000 Received: (qmail 8568 invoked by uid 89); 25 Oct 2022 16:41:57 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Received: (qmail 8561 invoked from network); 25 Oct 2022 16:41:57 -0000 X-Virus-Scanned: SPAM Filter at disroot.org Content-Type: text/plain; charset=UTF-8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1666715165; bh=4dYc+ALsWgU5OtJB5ccZ6/eZ7jQnPcAr/ealosUbtlE=; h=Cc:Subject:From:To:Date:References:In-Reply-To; b=Ozh3LzMWipbD+bPTXszwcVbvZyl5ur1OMuS3l9GvScU0EK4TEf67V8R/WQKpNyBZo 3yy0B2zgh25rxFbFHUAFo6hPbYFb/VYZQp5V+GvGSr43WVCoS/8tmOll7GjDbQ/7yt DCQkOLhBtBbmlcvwIU9szuLSH879QDHFUuWaazx7HPWfUm+ZWj0ezm4qDevwXzd1Ru ewgqN+45bNBcBQQ6UWsyjtAKVR8yVEFHD8Dhvi01IA40AJxFwJhZwIzEPhv1zCKInp bMjBS1Rr+TCrqWRunWr/cUukx5YeM4Fu8sdlTFLVYI6ESWh9VIbzsqC/WNgEYeRrJI pvNXrqtu81O3w== Cc: Subject: Re: ca catchall logger prefix log lines with service names? From: "Peter Shkenev" To: "Ihor Antonov" , Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Date: Tue, 25 Oct 2022 19:23:18 +0300 Message-Id: References: <20221025141920.rxxk6qkxpggloryt@localhost> In-Reply-To: <20221025141920.rxxk6qkxpggloryt@localhost> Hello, On Tue Oct 25, 2022 at 14:19 UTC, Ihor Antonov wrote: > I am trying to figure out if I can set up svscan catchall logger in such > a way that it prepends a service name to every log line, so that it can > be clear where the log came from. Service dirs are made for this. s6-log does not know the name of service - it just writes data from stdin to log directory, appending timestamps and handling rotation. > I am trying to avoid s6-rc setup where I need to explicitly create a > matching logger service. Having logger per service is the intended pattern for s6/s6-rc. This sets s6 logging framework apart from syslog and systemd-journald. s6 overview[1] and s6-log documentation[2] describes why logging is designed this way. And, again, s6-rc v1 and s6-frontend will make this easier. I am looking forward for them too. > Today I do this: > > s6-svscan $S6_RC_DIR | s6-log -- t s16777216 n64 $HOME/.local/log= /svscan As Laurent stated in the previous thread, do not do that. s6-svscan is not meant to be run in the terminal. > @400000006356da4b2cb3ba0a - a timestamp? Yes, this is a TAI64N timestamp. TAI64N is a reliable way to store timestamps[3], since it does not have leap seconds and does not suffer from problems like Y2K and Y2038. Also, these timestamps are easily machine-readable. If you want to read a log file with TAI64N timestamp, you can pipe it through s6-tai64nlocal program: cat $LOGDIR/current | s6-tai64nlocal | less Also, s6-log supports writing ISO 8601 timestamps, see s6-log documentation[2] for details. [1] https://skarnet.org/software/s6/overview.html [2] https://skarnet.org/software/s6/s6-log.html [3] http://skarnet.org/software/skalibs/libstddjb/tai.html --- Best regards, Peter