Re: [Json] JSON Log file encoding JSON-L

Jacob Davies <jacob@well.com> Wed, 07 May 2014 20:13 UTC

Return-Path: <cromis@gmail.com>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 6C09C1A018D for <json@ietfa.amsl.com>; Wed, 7 May 2014 13:13:03 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.278
X-Spam-Level:
X-Spam-Status: No, score=-1.278 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FM_FORGED_GMAIL=0.622, FREEMAIL_FROM=0.001, SPF_PASS=-0.001] autolearn=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3vHdIvqE5fM0 for <json@ietfa.amsl.com>; Wed, 7 May 2014 13:13:02 -0700 (PDT)
Received: from mail-wg0-x22f.google.com (mail-wg0-x22f.google.com [IPv6:2a00:1450:400c:c00::22f]) by ietfa.amsl.com (Postfix) with ESMTP id 338481A0398 for <json@ietf.org>; Wed, 7 May 2014 13:12:48 -0700 (PDT)
Received: by mail-wg0-f47.google.com with SMTP id x12so1542288wgg.30 for <json@ietf.org>; Wed, 07 May 2014 13:12:43 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=qOXixi84CfMRoeMXU0C/lx9xY5Ji202ldNg+QkNVrRU=; b=UmcrXUtoifn5KsmsYs9sQWOmjG69XmmOKcrKBVzlS1Pc1UQNpGPoBX6rXo2vrhtFYM ofIOxO2B2R0X/vGYWc8/c9NIpRr34tK6ZVazObk9BtV9L33h3NU+kajYjDBEVSDO+q21 nb44e6wSl5cuOoFx5utw+xwowP1PW0BR1xoFwwzz5qo+OE0uQGqfILSRCMi1LnZ/fesn 0pcfMoh7q4jQOaIuDPvRbj4YqDgzxN3OKfkrSesSrd4/tdX2Z5qyxbOqRqQOtJmD1fF+ F+KsW10ilJzzsncsWzKSkkjoNuCEdjHY7fxEAwm252rfNhBD8naFlZCiBLTxl5hDx/du jo8A==
X-Received: by 10.180.187.225 with SMTP id fv1mr89056wic.14.1399493563560; Wed, 07 May 2014 13:12:43 -0700 (PDT)
MIME-Version: 1.0
Sender: cromis@gmail.com
Received: by 10.217.141.203 with HTTP; Wed, 7 May 2014 13:12:23 -0700 (PDT)
In-Reply-To: <CAMm+Lwg-t3nc5-nk3JHV5RjKRQ+M9g8jY=VCKDAQU2G+Z1Mcdg@mail.gmail.com>
References: <CAMm+LwjB-51z4GoeC0riehmJg1HAddmLAyfMsVOCVM80i=RiMA@mail.gmail.com> <B9D8B85D-EF2C-4B3A-90A4-873C714C06FA@tzi.org> <CAK3OfOhGpUatFotCPwpHw=wu4zphxWOAk6dvX2UOZJRzw23JEA@mail.gmail.com> <CAK3OfOh1R851pBETEJtzM7_rCvrhxedCn5v5==nHumstE9VSRA@mail.gmail.com> <CAMm+LwiyJmk+3m25x28ZWhuCi84uW4O1iHn-N2CmXt_VzcDw9w@mail.gmail.com> <20140507011853.GA5011@mercury.ccil.org> <CAMm+Lwg-t3nc5-nk3JHV5RjKRQ+M9g8jY=VCKDAQU2G+Z1Mcdg@mail.gmail.com>
From: Jacob Davies <jacob@well.com>
Date: Wed, 07 May 2014 13:12:23 -0700
X-Google-Sender-Auth: KiKf85E7zi7gvsBAFQWMJYIn7g8
Message-ID: <CAO1wJ5RgAdDs2_HCsTV2TarOJzB460FDmMbiE7q-r7bvWHT37A@mail.gmail.com>
To: Phillip Hallam-Baker <hallam@gmail.com>
Content-Type: text/plain; charset="UTF-8"
Archived-At: http://mailarchive.ietf.org/arch/msg/json/Js3iSNWrzyfSsJpQNdJDlFmAxfA
Cc: Nico Williams <nico@cryptonector.com>, Carsten Bormann <cabo@tzi.org>, John Cowan <cowan@mercury.ccil.org>, JSON WG <json@ietf.org>
Subject: Re: [Json] JSON Log file encoding JSON-L
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <json.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/json>, <mailto:json-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/json/>
List-Post: <mailto:json@ietf.org>
List-Help: <mailto:json-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/json>, <mailto:json-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 07 May 2014 20:13:03 -0000

On Tue, May 6, 2014 at 7:05 PM, Phillip Hallam-Baker <hallam@gmail.com> wrote:
> And how do you know where these control characters are?

?

> If we are going to start using obscure ASCII control characters then
> we might as well co all binary. Trying to make use of them is going to
> make printers and all sorts of editors barf.

[Citation needed] I tried it in a few places and it either didn't
render at all or rendered as a single space. Since the format requires
sequences of JSON objects, that will result in either "}{" or "} {".

Compared to the alternative, which is requiring that the logged JSON
object have no internal newlines, it seems significantly more readable
to use a character for resynchronization that is already universally
illegal in JSON texts. I suggested RS because that is the actual
intended role of that control character and it is highly unlikely that
any existing JSON emitters pass it unescaped. FF (0x0c) is another
reasonable choice - well, I think you'd want \f\n - but I'm guessing
it's more likely to be erroneously passed unescaped by existing
emitters. Editor support is probably wider, but it's sort of a misuse
of the character.

All that being said I'm less convinced than I was when this was first
discussed that the "no internal newlines or whitespace, one object per
line, use newline for resynchronization" approach is all that bad.
It's not very human-readable but it would work well with existing
tools that operate on lines in log files, and I think most emitters
have a "compact" mode where no extraneous whitespace is included. I
think picking one format is more important than which one it is.