From nobody Mon Aug 29 04:04:24 2022 X-Original-To: freebsd-questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MGGzJ24BHz4b976 for ; Mon, 29 Aug 2022 04:04:28 +0000 (UTC) (envelope-from pete@nomadlogic.org) Received: from mail.nomadlogic.org (mail.nomadlogic.org [66.165.241.226]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mail.nomadlogic.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MGGzH1bf6z3NDT for ; Mon, 29 Aug 2022 04:04:27 +0000 (UTC) (envelope-from pete@nomadlogic.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nomadlogic.org; s=04242021; t=1661745865; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Yqz16QBQKKQr9yfEb7GEfHBmY98oDbBZ86lWoM+tACc=; b=3KaKlCDHqcaUVbZXHdvnNlX06bcODgDD/iVsWbz+ZTPRpRbQIg1+DISeLDDaVicbphGb0W GMeVxDIll1iFniPBRAsEhNPHAIC7G/nUR2Z24D3kcNhUZlNd294Ayq/iJenfxrD1Nmss4X Efp8SPkjcOZcCtxqNl1e5RnE4edxEvI= Received: from shelly.nomadlogic.org (66-165-241-229.static.hvvc.us [66.165.241.229]) by mail.nomadlogic.org (OpenSMTPD) with ESMTPSA id cd74c687 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Mon, 29 Aug 2022 04:04:24 +0000 (UTC) Date: Mon, 29 Aug 2022 04:04:24 +0000 From: Pete Wright To: freebsd-questions@freebsd.org Subject: Re: turn on timestamps in kernel log messages? Message-ID: <20220829040424.wdunjidqvprd76xn@shelly.nomadlogic.org> References: <20220828165715.fr3gvjk2esatukn5@shelly.nomadlogic.org> List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4MGGzH1bf6z3NDT X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=nomadlogic.org header.s=04242021 header.b=3KaKlCDH; dmarc=pass (policy=quarantine) header.from=nomadlogic.org; spf=pass (mx1.freebsd.org: domain of pete@nomadlogic.org designates 66.165.241.226 as permitted sender) smtp.mailfrom=pete@nomadlogic.org X-Spamd-Result: default: False [-3.00 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[nomadlogic.org,quarantine]; R_SPF_ALLOW(-0.20)[+mx]; R_DKIM_ALLOW(-0.20)[nomadlogic.org:s=04242021]; MIME_GOOD(-0.10)[text/plain]; ASN(0.00)[asn:29802, ipnet:66.165.240.0/22, country:US]; MIME_TRACE(0.00)[0:+]; MLMMJ_DEST(0.00)[freebsd-questions@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[nomadlogic.org:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROMTLD(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On Mon, Aug 29, 2022 at 01:04:27AM +0100, void wrote: > On Mon, Aug 29, 2022 at 12:46:45AM +0100, void wrote: > > On Sun, Aug 28, 2022 at 06:00:34PM -0400, Dan Langille wrote: > > > Did it work? > > > > Not sure yet > > > > This is with it set to 1: > > > > kernel log messages: > > +[2526502] tap3: link state changed to DOWN > > +[2526886] tap3: link state changed to UP > > +[2527114] tap3: link state changed to DOWN > > +[2527124] tap3: link state changed to UP > > +[2527231] tap3: link state changed to DOWN > > +[2527242] tap3: link state changed to UP > > # sysctl kern.msgbuf_show_timestamp=2 > > [2544779] tap12: link state changed to DOWN > [2544789] tap12: link state changed to UP > [2545295] tap12: link state changed to DOWN > [2545306] tap12: link state changed to UP > > so, unfortunately it doesn't give a useful timestamp. > > What I'm looking for is something like 2022-08-29.01:02.05 BST > or even just 2022-08-29.01:02 might be worth adjusting your syslog.conf to capture all kern.* messages, then they'll land in /var/log/messages or somewhere similar and have human readable timestamps. here's an example from my /var/log/messages file: Aug 26 15:50:30 topanga kernel: tun0: link state changed to Up hope this helps, -pete -- Pete Wright pete@nomadlogic.org