Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F21677EDC for ; Wed, 7 Dec 2011 09:19:41 +0000 (UTC) Received: (qmail 49598 invoked by uid 500); 7 Dec 2011 09:19:41 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 49520 invoked by uid 500); 7 Dec 2011 09:19:38 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 49506 invoked by uid 99); 7 Dec 2011 09:19:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Dec 2011 09:19:38 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of volker.mische@gmail.com designates 209.85.214.52 as permitted sender) Received: from [209.85.214.52] (HELO mail-bw0-f52.google.com) (209.85.214.52) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Dec 2011 09:19:31 +0000 Received: by bke17 with SMTP id 17so248347bke.11 for ; Wed, 07 Dec 2011 01:19:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=JF1O5xWG3rH8+RJlQXitn9GMf90TLXtFJvGEjZVV2Uk=; b=fSNf3Hj5vGDbo43Sv+ZgK1ov15ePriRNgCpx+awZRSdKayX0fboCcuuUM+c/SDZBQ5 yMJPzPvnFYqowMlg1HTGAerzQV+pw0U24nntKUAD4q8ZTC+YdQUeGnEewDpiKXLtNXqM TTrGnDdCA7ifXMXBNNk1my9WE2FUqB1oF+aZQ= Received: by 10.180.104.2 with SMTP id ga2mr27941107wib.33.1323249551129; Wed, 07 Dec 2011 01:19:11 -0800 (PST) Received: from [192.168.0.6] (dslb-084-056-016-216.pools.arcor-ip.net. [84.56.16.216]) by mx.google.com with ESMTPS id z35sm1939113wbm.12.2011.12.07.01.19.06 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 07 Dec 2011 01:19:09 -0800 (PST) Message-ID: <4EDF2F8B.1000006@gmail.com> Date: Wed, 07 Dec 2011 10:19:07 +0100 From: Volker Mische User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20110805 Icedove/5.0 MIME-Version: 1.0 To: dev@couchdb.apache.org CC: Jason Smith Subject: Re: The perfect logger for development References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Don't forgot the request body when it was a PUT/DELETE. Cheers, Volker On 12/07/2011 05:24 AM, Jason Smith wrote: > Brilliant, thanks! > > I think this is possible if the Req object is part of the log object. > Then a formatter can access it there. Off the top of my head, it would > have access to the source IP address, the HTTP method, the path and > query string, and headers. > > On Wed, Dec 7, 2011 at 10:44 AM, kowsik wrote: >> As a CouchDB administrator, I would want *all* exception dumps to be >> prefaced by the inbound request URL with the query parameters >> (assuming it's a web request that caused the exception). There are >> case where I've seen a stack trace but couldn't tell which inbound >> request caused the problem. >> >> K. >> --- >> http://blitz.io >> @pcapr >> >> On Tue, Dec 6, 2011 at 5:51 PM, Jason Smith wrote: >>> Hi, all. Iris Couch urgently needs improved logging facilities in >>> CouchDB. My goal is to make something we all love and get it accepted >>> upstream, God willing. Or committers willing. But I repeat myself! >>> >>> This is the brainstorming and requirements gathering phase. In the >>> CouchDB of your dreams, logging system fits you like an old pair of >>> sneakers. It's perfect. Now, what characteristics does that system >>> exhibit? I will compile feedback into a spec on the wiki. >>> >>> I hope to avoid bikeshedding. Seriously, please don't even mention a >>> product or project by name. At this phase I hope to stick to >>> descriptions of functionality, goals, and non-goals. I want to >>> evaluate tools later. >>> >>> To start the discussion: logging is viewed differently based on your >>> relationship with CouchDB: >>> >>> 1. Developers of CouchDB >>> 2. Administrators of a couch >>> 3. Application developers >>> >>> My roles are administration, and a little bit of development. >>> Requirements, in no order. >>> >>> * Idiomatic Erlang >>> >>> * Is a compelling place for new people to contribute. Miguel de Icaza >>> talks about this. It's not enough that the source code is public. You >>> have to provide a smooth on-ramp, where people people get great bang >>> for their buck. They write a modest feature, and are rewarded by >>> seeing its effects immediately. In other words: plugins. Or maybe a >>> behaviour. Or some way to swap in formatters and data sinks. I don't >>> want to write a Loggly target (http://loggly.com). Loggly should be >>> begging me to merge their module. >>> >>> * 1st cut, no change to the default behavior. You still get the that >>> peculiar log file you know and love. People are parsing their log >>> files, and might expect version 1.x not to change. >>> >>> * Existing code still works. No sweeping changes hitting every >>> ?LOG_INFO and ?LOG_DEBUG. >>> >>> (Filipe, would you please share your thoughts on these? I think you >>> struggled with the conflict between them recently.) >>> * No performance impact (non-blocking)... >>> * ... but also, impossible or difficult to overwhelm or crash or lose logs. >>> >>> (The next few points sort of fit together) >>> >>> * Logs are not strings, but data structures, with data (the log >>> message) and metadata (severity, line number, maybe the call stack, >>> etc.) >>> >>> * More log levels. Roughly: trace, debug, info, warn, error, fatal >>> >>> * Maybe automatic trace logs upon function entry/exit with return >>> values. Not sure if this is doable. Maybe a compile option, for `make >>> dev` >>> >>> * When you log something, your module, line number, and maybe PID are known >>> >>> * "Components" or categories, or tags, where multiple .erl files or >>> individual log events can share a common property ("http", "views", >>> >>> * A policy decides what to do with logs based on level, module, or >>> component. You can set the policy either via configuration or >>> programatically. >>> >>> * There is a formatter API to serialize log data. Built-in formatters >>> include the legacy format, and Jan's Apache httpd combined format. >>> >>> * There is a transport API to receive logs and DTRT. >>> >>> * I know this is insane, but kill -HUP should make couch reopen >>> its log files. Okay, I'll settle down now. >>> >>> = Non Goals = >>> >>> * Log rotation. I have never seen a rotation feature in an application >>> which was better than the OS tools. And you can get problem where both >>> the server and the OS are rotating the same logs. I have seen that >>> happen, twice. Or was it once? Of course, people could write a >>> rotating file transport. >>> >>> -- >>> Iris Couch > > >