From owner-freebsd-hackers@freebsd.org Mon Apr 2 10:22:09 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48898F82630 for ; Mon, 2 Apr 2018 10:22:09 +0000 (UTC) (envelope-from woodsb02@gmail.com) Received: from mail-ot0-x22c.google.com (mail-ot0-x22c.google.com [IPv6:2607:f8b0:4003:c0f::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CC71578030 for ; Mon, 2 Apr 2018 10:22:08 +0000 (UTC) (envelope-from woodsb02@gmail.com) Received: by mail-ot0-x22c.google.com with SMTP id n40-v6so15150034otd.3 for ; Mon, 02 Apr 2018 03:22:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Dc/jqHXb8z6U5Ef67tnsRpkB5O7Ua0OHG4RAYB0J/9c=; b=eHK93hi2/Ve5EZlRLAu9MV2odCfLiEeEjzU3f5TlaHa7NX5fVg+wbwMwZY9KAEFFl6 p/+lx3H3eJslkxoPx8R/Db5ySHSxglspUSdmj635nZn4XmXLVdZ15j1lpKDCbBc1JmK5 s5M4z7T9nC0Cch/ioz3Sg6ExF4s0jFRo2cvugetMCmxn4a7rWHP7tneBfaBA22nd28L+ hdvXDwo/3XSh1XRtVsTmCVW16WkwYUl20mN20LUzi6NdE5nKOcI0BwRi2cjpKa5Rswp0 IDLQVIRtFmSDC/qiKYxVZg5YQ7GZusg/xW5KJf4IjmkUhvsqxPf1G+xDSgLjn0oZsMmv cnXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Dc/jqHXb8z6U5Ef67tnsRpkB5O7Ua0OHG4RAYB0J/9c=; b=IYea0PcmTTou8cHUwgRQ8da321vdGnl7EMviJ5WUyXExceKztSzuFXlp+GdGBmfBSH NJ2aH4mkEybqmqYMFgI7Zxo6TDeqai1EhI7cpBC7PWEpwk4Gi6vmSVfQp2L/0JWgf/8/ rUJc6e9xKvbXwBK5Ee2NMGbJhXLhqzwMUXiTH8dmIp38I0m6ZqGGodEMyc+JqTI3al8U EvbvHbWGvTKChz8rwyChJHlcZZFLhjvZc7D/Jhz9/QFw3cZINJgI8k7bUlpDsltyq6o/ dsB6XNS761LjW1DT6YTI4tO6On+9B8J6ZDgo9eTtdl+GIyJGF+Q97h1KoipFJDEQsj8O oLyw== X-Gm-Message-State: ALQs6tC+0lSvzjtREzJswlnkSxGNENnMNG7bOVhC2YwffVyFFCWU8Ace h4f7BdvgSjcI4jMptHQGqhn1pPmE4Z/carrneNyXboWG X-Google-Smtp-Source: AIpwx491sSPRlAf06A1yzulwdJ1bqvfkIZ6GLQg6Wkjqu5DN4q+gxadhedxunuS1nH+jZ9v7fbdUQ4QjIrZ8GBQDsMQ= X-Received: by 2002:a9d:1722:: with SMTP id i34-v6mr5508789ota.195.1522664528229; Mon, 02 Apr 2018 03:22:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.201.15.247 with HTTP; Mon, 2 Apr 2018 03:22:07 -0700 (PDT) In-Reply-To: References: From: Ben Woods Date: Mon, 2 Apr 2018 18:22:07 +0800 Message-ID: Subject: Re: Add option -Z to syslogd(8) to use ISO 8601 timestamps To: Ed Schouten Cc: "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Apr 2018 10:22:09 -0000 On 2 April 2018 at 03:33, Ed Schouten wrote: > Wow! That's a coincidence. I actually started working on something in > the same area a couple of days ago. One of our customers requires > sub-second precision of log entries, which is why I implemented RFC > 5424 support for FreeBSD's syslogd a couple of days ago. I sent out a > pull request a couple of minutes ago and only noticed your email just > now. > > https://reviews.freebsd.org/D14926 > > This patch doesn't change the output format of syslogd. It only adds > the RFC 5424 parsing and changes the internal model of syslogd to be > based on RFC 5424. Changing the output format to use ISO 8601 > formatting was planned for a separate change. > > What are your thoughts on my pull request? If you like it, maybe it > makes more sense to land my change first before applying yours? > > -- > Ed Schouten > Nuxi, 's-Hertogenbosch, the Netherlands > Hi Ed, That is a coincidence. Having looked through your code, I realise it is far better than mine, and mine actually resulted in the syslogd output being non-compliant with both RFC3164 and RFC5424 (by using the RFC5424 timestamp format with the remainder of the log matching the RFC3164 format). I have therefore abandoned my review in favour of yours. My effort has not been wasted though, as it meant that I was recently familiar with the syslogd.c code, and the contents of RFC3164 and RFC5424, and therefore had a headstart in reviewing your patch. I have provided some comments in phabricator for your consideration. I think you have already handled the hard part of the migration to RFC5424, which is the updated parsing logic. Whilst you have yet changed the log output format to RFC5424, I suspect that will be the easy bit. When it comes time to change the output format, it is worth noting that NetBSD has provided the "-o" syslogd argument to allow the sysadmin to select the output format: -o output_format Select output message format. bsd, rfc3164 traditional BSD Syslog format (default) syslog, rfc5424 new syslog-protocol format Regards, Ben -- From: Benjamin Woods woodsb02@gmail.com