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

Phillip Hallam-Baker <hallam@gmail.com> Wed, 07 May 2014 20:46 UTC

Return-Path: <hallam@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 532551A02F6 for <json@ietfa.amsl.com>; Wed, 7 May 2014 13:46:21 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, SPF_PASS=-0.001] autolearn=ham
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 RoP7rRmlV21c for <json@ietfa.amsl.com>; Wed, 7 May 2014 13:46:19 -0700 (PDT)
Received: from mail-lb0-x231.google.com (mail-lb0-x231.google.com [IPv6:2a00:1450:4010:c04::231]) by ietfa.amsl.com (Postfix) with ESMTP id 23D221A01A0 for <json@ietf.org>; Wed, 7 May 2014 13:46:18 -0700 (PDT)
Received: by mail-lb0-f177.google.com with SMTP id s7so2143790lbd.8 for <json@ietf.org>; Wed, 07 May 2014 13:46:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=qhks9CwIJQGYeF+5gWV8onlTJiDAtZdCF1JC+J4ryAU=; b=sbW9G6PqSnfrO5OZsiDeh3okEhuhL+LYdNVeYQg7vbaM5buvZSirowF68tpfRoSct8 TgmdO6bn5stm+GahIt+fgB3R3QqgBVdg1NSR+puLFxJZ5eBnOPEuWwO41lwVUHElfIOY 6n2jwDOFXCHTZNp2Liz1wyrk7Ln9bjfeP+X2Gu91wZv5ioWa3kDgrAceuf6aeKv8veFi fb3dBG3KcwtkBWrfJVIqvggjoKw99A8nSm/Jc4wz51AAt7SwXAJA/O5rikle9pFICgMR VUKyn/NyQKYg+Orb4YF5nA059E3c9cIZHnNDvCOsAxlUknNwRwAMc6x3G/6H5KWpSw7q 77aw==
MIME-Version: 1.0
X-Received: by 10.112.41.101 with SMTP id e5mr5592975lbl.46.1399495573987; Wed, 07 May 2014 13:46:13 -0700 (PDT)
Received: by 10.112.234.229 with HTTP; Wed, 7 May 2014 13:46:13 -0700 (PDT)
In-Reply-To: <CAK3OfOhG_jV++07iLF1ga6tJCKYiEeW_4=U7=HLR8Aq-KYPV3g@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> <CAO1wJ5RgAdDs2_HCsTV2TarOJzB460FDmMbiE7q-r7bvWHT37A@mail.gmail.com> <CAK3OfOhG_jV++07iLF1ga6tJCKYiEeW_4=U7=HLR8Aq-KYPV3g@mail.gmail.com>
Date: Wed, 07 May 2014 16:46:13 -0400
Message-ID: <CAMm+LwgyXdSvmSx13boRZJJycQUO4Vsv=zTrHGrL_q0=2PM3hg@mail.gmail.com>
From: Phillip Hallam-Baker <hallam@gmail.com>
To: Nico Williams <nico@cryptonector.com>
Content-Type: text/plain; charset="UTF-8"
Archived-At: http://mailarchive.ietf.org/arch/msg/json/En5TRm_zTgfILjVCPDtUr3S8WbQ
Cc: John Cowan <cowan@mercury.ccil.org>, Carsten Bormann <cabo@tzi.org>, Jacob Davies <jacob@well.com>, 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:46:21 -0000

If I open up a file with an RS character in it using notepad, how is
it going to look?

Since RS is effectively an obsolete character the best I would expect
is to see ? all over the place.

Unix and Windows both came to the conclusion that the only control
characters that are used are CR, LF and TAB. And CR is only used
because the Internet adopted CRLF as the line ending sequence rather
than LF.

JSON is a text based encoding. It is not the place to attempt to
resurrect long abandoned control character conventions.



On Wed, May 7, 2014 at 4:38 PM, Nico Williams <nico@cryptonector.com> wrote:
> On Wed, May 7, 2014 at 3:12 PM, Jacob Davies <jacob@well.com> wrote:
>> 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?
>
> With od(1), for example :)
>
>> ?
>
> +1 :)
>
>>> 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 "} {".
>
> Good!
>
>> 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.
>
> The RS thing should be OPTIONAL, to be used when writing entries in a
> log-like way (e.g., using O_APPEND), because of the potential for
> corruption in the face of interrupted writes.
>
>> 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.
>
> Right, writing entries with no internal newlines is easy enough for
> log writers, and hardly a problem for anyone consuming logs.
>
> Nico
> --



-- 
Website: http://hallambaker.com/