Re: [Json] Using JSON in log files

Phillip Hallam-Baker <hallam@gmail.com> Wed, 20 November 2013 19:20 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 1D6931AE13E for <json@ietfa.amsl.com>; Wed, 20 Nov 2013 11:20:12 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.399
X-Spam-Level:
X-Spam-Status: No, score=-1.399 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, HTML_MESSAGE=0.001, J_CHICKENPOX_34=0.6, 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 FUebWDduh1jL for <json@ietfa.amsl.com>; Wed, 20 Nov 2013 11:20:10 -0800 (PST)
Received: from mail-la0-x22a.google.com (mail-la0-x22a.google.com [IPv6:2a00:1450:4010:c03::22a]) by ietfa.amsl.com (Postfix) with ESMTP id 6C5841AE135 for <json@ietf.org>; Wed, 20 Nov 2013 11:20:10 -0800 (PST)
Received: by mail-la0-f42.google.com with SMTP id ec20so7718775lab.15 for <json@ietf.org>; Wed, 20 Nov 2013 11:20:03 -0800 (PST)
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=WFbEoVsusA2RV1ormFPHnM5c/2eYvkB36Rw/oeJ1A14=; b=wo3zSBcAkomJ+E2PSw27cmCAIIXLcBXzeZn01qHWZIUsY5+StJAbvBsLICfJ7bYWQT qWQVdylWoei+I4vGWBlLNjM+q3QbCYxcMnXHNkEUCD7jCaYyul3Q9bhugEMFqcFPsOgU BfLUMNAE6yKU9JQXnXnIFXnqwaaQ8DKTPDgmt6vst4Cb8rwXDDGD5ui2GXBhT3sCxJm+ eH503w6fN1cH/F3nV604oYSJENMV/NRe0LetskhMDR8a1I9QaZnZjSm7OouwQsEazSys IEpmrpnF79+Y+kkM1pxshk4D6+zWX2N7KFkpoWv+Bu4dTXqWndQXFasj1+f26kGXpZF0 gVQg==
MIME-Version: 1.0
X-Received: by 10.112.77.169 with SMTP id t9mr1576478lbw.3.1384975203287; Wed, 20 Nov 2013 11:20:03 -0800 (PST)
Received: by 10.112.46.98 with HTTP; Wed, 20 Nov 2013 11:20:03 -0800 (PST)
In-Reply-To: <CAGrxA26qXDve-fhW2zG8jHeiwFvaVrJ9WBa=e83yQ1mLqKVDrA@mail.gmail.com>
References: <CAMm+Lwj49w5qq3V8tLta_GPq3TT5A0FXuKww5RXHbe74dQ5jjA@mail.gmail.com> <CAGrxA26qXDve-fhW2zG8jHeiwFvaVrJ9WBa=e83yQ1mLqKVDrA@mail.gmail.com>
Date: Wed, 20 Nov 2013 14:20:03 -0500
Message-ID: <CAMm+LwjirT9wZTO1wQnJtj_qJwMe0s76dSnJQtnicU_g5EPcBg@mail.gmail.com>
From: Phillip Hallam-Baker <hallam@gmail.com>
To: Tatu Saloranta <tsaloranta@gmail.com>
Content-Type: multipart/alternative; boundary="001a11c3ecfa03cc2904eba0ab33"
Cc: JSON WG <json@ietf.org>
Subject: Re: [Json] Using JSON in log files
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, 20 Nov 2013 19:20:12 -0000

On Wed, Nov 20, 2013 at 1:22 PM, Tatu Saloranta <tsaloranta@gmail.com>wrote:

> This is one of canonical use-cases for streaming JSON processing: just use
> linefeed between root-level values. Many/most streaming JSON readers
> support this, especially Java ones (Jackson definitely does; GSON has
> streaming mode, Genson as well; org.json's toy lib should not be used for
> anything).
> It also makes it easier to read, should you need to check out log files.
>
> Or, if you want to be strictly compliant with specs, use a container JSON
> array.
> Streaming readers (and generators) should work fine here as well.
> There is no need to buffer the whole log stream in buffer either when
> reading or writing.
>

Thanks, I will do that.

Given that this seems to be a common extension, shouldn't we document it as
such?

What other common extensions are in use?


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