From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 9B6C77FA5F for ; Tue, 17 Jan 2017 20:20:26 +0100 (CET) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=mmatalka@gmail.com; spf=Pass smtp.mailfrom=mmatalka@gmail.com; spf=None smtp.helo=postmaster@mail-wm0-f65.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of mmatalka@gmail.com) identity=pra; client-ip=74.125.82.65; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="mmatalka@gmail.com"; x-sender="mmatalka@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of mmatalka@gmail.com designates 74.125.82.65 as permitted sender) identity=mailfrom; client-ip=74.125.82.65; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="mmatalka@gmail.com"; x-sender="mmatalka@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-wm0-f65.google.com) identity=helo; client-ip=74.125.82.65; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="mmatalka@gmail.com"; x-sender="postmaster@mail-wm0-f65.google.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3AID4zKRDcqRtO0JT3ggp6UyQJP3N1i/DPJgcQr6Af?= =?us-ascii?q?oPdwSP7+pcbcNUDSrc9gkEXOFd2CrakV16yN7Ou5AzVIoc7Y9itdINoUD15NoP?= =?us-ascii?q?5VtjJjKfbNMVf8Iv/uYn5yN+V5f3ghwUuGN1NIEt31fVzYry76xzcTHhLiKVg9?= =?us-ascii?q?fbytScb6xv663OGq+pDVfx4AxH/kOeszfyONsB7Ju8IKrYxnI6c3gluV8zobM9?= =?us-ascii?q?hRkEFlPkqehV7Y4dqx59ZK9Shdoeks8YYUU6jhZ6kiC7hfETU9dWkz6MDxrhTF?= =?us-ascii?q?ZQSK73oYFG4Rl0wbLRLC6UTfV5P6tS///s90xCCePsS+GbUxUCir66RiYBDtgS?= =?us-ascii?q?YDcTU+9TeE2YRLkKtHrUf59FREyInObdTQaaNz?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0CqAAAZbX5Yf0FSfUpdGwEBAQMBAQEJA?= =?us-ascii?q?QEBFgEBAQMBAQEJAQEBgw4BAQEBAX54EY1YkhiCNpJ2ggsqgkKDNgKBXT8YAQE?= =?us-ascii?q?BAQEBAQEBAQESAQEJCwsKGzKCMwQBFgWCFgEBAQMBQAEbEgsBAwELBgULDQkEI?= =?us-ascii?q?Q8BBA0CEQEFAQoYExKIVQEDEAgECqJ/P44GBQEcgwkFg2IKGScDClWCDAEBAQE?= =?us-ascii?q?BAQEBAQEBAQEBAQEBAQEXAgYJAQiEK4IIhGeCUIdcBYckDJNSOIZdhn6EBIF3U?= =?us-ascii?q?YdYMoYbihiHDjKBFB+BTRIIFRU6FIQUggpzAYcIgU8BAQE?= X-IPAS-Result: =?us-ascii?q?A0CqAAAZbX5Yf0FSfUpdGwEBAQMBAQEJAQEBFgEBAQMBAQE?= =?us-ascii?q?JAQEBgw4BAQEBAX54EY1YkhiCNpJ2ggsqgkKDNgKBXT8YAQEBAQEBAQEBAQESA?= =?us-ascii?q?QEJCwsKGzKCMwQBFgWCFgEBAQMBQAEbEgsBAwELBgULDQkEIQ8BBA0CEQEFAQo?= =?us-ascii?q?YExKIVQEDEAgECqJ/P44GBQEcgwkFg2IKGScDClWCDAEBAQEBAQEBAQEBAQEBA?= =?us-ascii?q?QEBAQEXAgYJAQiEK4IIhGeCUIdcBYckDJNSOIZdhn6EBIF3UYdYMoYbihiHDjK?= =?us-ascii?q?BFB+BTRIIFRU6FIQUggpzAYcIgU8BAQE?= X-IronPort-AV: E=Sophos;i="5.33,245,1477954800"; d="scan'208";a="255850716" Received: from mail-wm0-f65.google.com ([74.125.82.65]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 17 Jan 2017 20:20:25 +0100 Received: by mail-wm0-f65.google.com with SMTP id d140so24405556wmd.2 for ; Tue, 17 Jan 2017 11:20:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=WAJLSA4LMmNly7kv5BGzYN7kEzjwaJK4BSigypow7/4=; b=gSmqB9b0OO8uINWe9dfBnFQIhE12rqg2r1M1Sh26B8tvBk5LGvPbZZirXrAiqESvYp qoWS+JmhpeRGnRhJhGaQo8VtSn6bmWSHiVGZdhQeU69ZIkt2F13VoVFyBLayalWcXzDH RfoR2wUz71gPh6tquYDCL+k3oPaHbYYAi/lyyctuVJCfl1vKe/Y9+7BZXXCDg3buLPb3 4d219Us+NGJPyT3Ziow5ALQwFIJkcK16HzaRdcNV7M/b349sMDoWPSnI5DFpKjFCCAFK HGBvfOXGnRhFJSn7eWMgFFxTF6riCCfvskYCbhlBnMKQAIy8nPSRmd7We+KVNy1l3IAd EY/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=WAJLSA4LMmNly7kv5BGzYN7kEzjwaJK4BSigypow7/4=; b=Y6z0NgzeReOnmnC3gE5TeWkA9o7Jr+yMYX7ole74OhIDOADTkEAHOb+fnbk7x7I1TD 0sRB2MsCBKpReE0RWJaCrv9ZXhgGzb/5gJKIgJmNexBJ+7NggzOjzAb4nDnPhTsw1VHU d4WSJ1srqwo/AwKzbdE/vZV8VT0sV1kHYYAW0PYM6k6WwaLDc8VRwqIdUSyVDaa4oms0 2XBalGfRohzpWU/FkWXaxpOIE9hjyjx6kz6OhQsV7/tAJIT1M/PfrQlk81jC0hIjfqEJ ud7JQRZ67srxdB9qnq1JmS2X292v40DuXrrX9fEQ4fEavor0JWYy4Ww9XUyC9pp+23Hb Envw== X-Gm-Message-State: AIkVDXLHJ5ox37DBe4P2sWa+xl+auMRZKPrg7HNfn+1GKhae+iLS3WIrA0g48wZy+q7QJg== X-Received: by 10.223.171.66 with SMTP id r2mr6591875wrc.71.1484680825522; Tue, 17 Jan 2017 11:20:25 -0800 (PST) Received: from localhost ([37.153.108.22]) by smtp.gmail.com with ESMTPSA id o143sm7878864wmd.3.2017.01.17.11.20.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Jan 2017 11:20:24 -0800 (PST) From: Malcolm Matalka To: Jesper Louis Andersen Cc: Anil Madhavapeddy , Chet Murthy , "caml-list\@inria.fr users" References: <2383491.giY4FN1y6Q@twitter> <6099A589-2D9B-4394-B727-E7F8B26067FD@recoil.org> Date: Tue, 17 Jan 2017 19:20:23 +0000 In-Reply-To: (Jesper Louis Andersen's message of "Tue, 17 Jan 2017 11:52:32 +0000") Message-ID: <86bmv5biiw.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Caml-list] A question about Ocaml logging Jesper Louis Andersen writes: > Another point from the trenches of the real world: > > I've had great success with metrics over logging in many situations. > > Logs are really nice for knowing what went wrong in a system. And if the > logs have some kind of structure (JSON, S-exps, Erlang Terms, ...) you can > also dump all context information relevant to the log entry. Modern systems > such as Kibana can read such structure and build a search index over them. > It is very useful when trying to figure out what went wrong. In a > distributed system, you keep a unique request id in the structural log so > you can join log entries from multiple subsystems easily in the centralized > logging platform. > > Likewise, whenever a given event occurs, you bump a counter or add an entry > to a histogram (HdrHistogram comes to mind). This allows you to export > counts to a foreign system for plotting of how the system fares internally. > It is much cheaper than rendering a log line in the system, and it is > almost as informative if you don't need the log line, but rather its > occurrence. Live timing histograms also has the advantage that problems > tend to show up in the small before a catastrophe. So you can alter the > operating point of the system dynamically long before the catastrophe occur > in the real world. > > I almost never have debug-style logging lines in my code anymore. I much > prefer adding a live tracing to the system instead (Erlang has tracing > facilities, DTrace is useful on Illumos and FreeBSD, etc). Granted, > you Is it possible to create dtrace probes in Ocaml code? > can't do this posthumously of an error, but on the other hand, you can > tailor it to the situation you have. It also takes care of the need to > recompile and redeploy with debug logging (in which case you can't > posthumously handle an error). > > The right way to handle system failure is to take a snapshot of the systems > state (or of part of the system to which the problem pertains). Store this > snapshot somewhere (in the cloud) and index them, so you can go back with a > debugger, attach to the core dump, and inspect what went wrong. Post-mortem > debugging is needed because many of the errors which occur lies outside the > imagination of the programmers: people abuse systems in ways nobody thought > possible. > > > On Mon, Jan 16, 2017 at 4:15 PM Anil Madhavapeddy wrote: > >> > On 9 Jan 2017, at 18:52, Chet Murthy wrote: >> > >> > All, >> > >> > I hope this is the right place to ask this question. I've been >> > writing a nontrivial distributed system (well, a number of them over >> > the last few years) and have had need of a robust and flexible logging >> > framework. Specifically, I've been using "bolt" and its descendant, >> > "volt", which provide camlp4 syntax extensions. These extensions make >> > the syntax of the logging statements significantly less verbose, and >> > that in itself ia a valuable thing. >> > >> > With the arrival of ppx rewriters, I realize that the camlp4/camlp5 >> > method of adding syntax to ocaml is deprecated. So I wonder: is there >> > some really good logging toolkit out there, that I've overlooked. >> > >> > I'm aware of a number of different packages, but only bolt/volt have >> > syntax extensions, and it's my belief that they're essential to making >> > effortless pervasive log-line instrumentation. >> > >> > But perhaps I just haven't looked hard enough .... So .... before I >> > go write my own, I figured I'd ask the list if there were such a >> > thing. >> >> Dear Chet, >> >> In MirageOS, we've been moving away from syntax extensions and >> towards placing the logging directives as closures directly within the >> code. This is slightly slower in the case of debug logging, but in >> practise for distributed systems we are finding that having "permanent" >> logging at different levels is more valuable than the "recompile with >> debug logging" that we used to use. >> >> The basis library for this that our libraries are mostly using now in the >> forthcoming MirageOS3 is Daniel Buenzli's Logs library: >> http://erratique.ch/software/logs >> >> It does not have a syntax extension out of the box, but it does provide >> flexible support for multiple backends, and has an Lwt module included. >> >> Hope that helps! >> >> regards, >> Anil >> >> >> >> >> -- >> Caml-list mailing list. Subscription management and archives: >> https://sympa.inria.fr/sympa/arc/caml-list >> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners >> Bug reports: http://caml.inria.fr/bin/caml-bugs >>