From mboxrd@z Thu Jan 1 00:00:00 1970 Delivered-To: chneukirchen@gmail.com Received: by 10.86.23.1 with SMTP id 1cs154401fgw; Fri, 28 Aug 2009 22:15:22 -0700 (PDT) Received-SPF: pass (google.com: domain of grbounce-ceibQwUAAAB4YPBqaDIjI2bFOCxyyh3G=chneukirchen=gmail.com@googlegroups.com designates 10.140.163.12 as permitted sender) client-ip=10.140.163.12; Authentication-Results: mr.google.com; spf=pass (google.com: domain of grbounce-ceibQwUAAAB4YPBqaDIjI2bFOCxyyh3G=chneukirchen=gmail.com@googlegroups.com designates 10.140.163.12 as permitted sender) smtp.mail=grbounce-ceibQwUAAAB4YPBqaDIjI2bFOCxyyh3G=chneukirchen=gmail.com@googlegroups.com; dkim=pass header.i=grbounce-ceibQwUAAAB4YPBqaDIjI2bFOCxyyh3G=chneukirchen=gmail.com@googlegroups.com Received: from mr.google.com ([10.140.163.12]) by 10.140.163.12 with SMTP id l12mr1943541rve.27.1251522920608 (num_hops = 1); Fri, 28 Aug 2009 22:15:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=domainkey-signature:received:received:x-sender:x-apparently-to :received:received:received:received-spf:received:date:from:to :subject:message-id:mime-version:content-type:content-disposition :user-agent:reply-to:sender:precedence:x-google-loop:mailing-list :list-id:list-post:list-help:list-unsubscribe:x-beenthere-env :x-beenthere; bh=yo5NRen+fmsrg+n9Vi9L0rTIGIq5OmpmXEKXVWV8tyk=; b=qPH90r114cLS/YvtRG1Gxg8B2m16NyPf/yj2fnt6sFjOluv5EpQiUk8p96JYgFiuV7 14QVhS+5YPxspY0VYqQbnIMT3Sqexl3628Dr/qohaedKJdloAw8dv5rxdW/EhRR5lv+s bS/00dbg9/RI36oNv1r+AlZXl8aIHrQOSqF1I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlegroups.com; s=beta; h=x-sender:x-apparently-to:received-spf:authentication-results:date :from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent:reply-to:sender:precedence :x-google-loop:mailing-list:list-id:list-post:list-help :list-unsubscribe:x-beenthere-env:x-beenthere; b=XOwDskqs6pr2XQ9Eep95xJlTn5CNaR5pXI4aAoIOIKGrkImeyRlCEIo3e1DY5lPkTw /PUgB3NbRU812593pwvDWAQKZmRKH/rUl5TA7HbUr21gZG836i+Jq0YPUUFVZeVv/yhg KubbhtYa6HnwAiE7Is1JegOERNuai3fZG7sas= Received: by 10.140.163.12 with SMTP id l12mr371128rve.27.1251522920558; Fri, 28 Aug 2009 22:15:20 -0700 (PDT) Received: by 10.107.167.28 with SMTP id u28gr1617pro.0; Fri, 28 Aug 2009 22:15:07 -0700 (PDT) X-Sender: normalperson@yhbt.net X-Apparently-To: rack-devel@googlegroups.com Received: by 10.141.15.11 with SMTP id s11mr445196rvi.27.1251522905579; Fri, 28 Aug 2009 22:15:05 -0700 (PDT) Received: by 10.141.15.11 with SMTP id s11mr445195rvi.27.1251522905563; Fri, 28 Aug 2009 22:15:05 -0700 (PDT) Return-Path: Received: from dcvr.yhbt.net (dcvr.yhbt.net [64.71.152.64]) by gmr-mx.google.com with ESMTP id 19si278561pzk.0.2009.08.28.22.15.05; Fri, 28 Aug 2009 22:15:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of normalperson@yhbt.net designates 64.71.152.64 as permitted sender) client-ip=64.71.152.64; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of normalperson@yhbt.net designates 64.71.152.64 as permitted sender) smtp.mail=normalperson@yhbt.net Received: from localhost (user-118bg0q.cable.mindspring.com [66.133.192.26]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPSA id 258411F798; Sat, 29 Aug 2009 05:15:04 +0000 (UTC) Date: Fri, 28 Aug 2009 22:15:03 -0700 From: Eric Wong To: rack-devel@googlegroups.com Subject: [ANN] clogger 0.0.1 Message-ID: <20090829051503.GC17495@dcvr.yhbt.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Reply-To: rack-devel@googlegroups.com Sender: rack-devel@googlegroups.com Precedence: bulk X-Google-Loop: groups Mailing-List: list rack-devel@googlegroups.com; contact rack-devel+owner@googlegroups.com List-Id: List-Post: List-Help: List-Unsubscribe: , X-BeenThere-Env: rack-devel@googlegroups.com X-BeenThere: rack-devel@googlegroups.com = Clogger - configurable request logging for Rack * http://clogger.rubyforge.org/ * mailto:clogger@librelist.com == DESCRIPTION Clogger is Rack middleware for logging HTTP requests. The log format is customizable so you can specify exactly which fields to log. == FEATURES * highly customizable with easy-to-read nginx-like log format variables. * pre-defines Apache Common Log Format, Apache Combined Log Format and Rack::CommonLogger (as distributed by Rack 1.0) formats. * Untrusted values are escaped (all HTTP headers, request URI components) to make life easier for HTTP log parsers. The following bytes are escaped: ' (single quote) " (double quote) all bytes in the range of \x00-\x1f == SYNOPSIS Clogger may be loaded as Rack middleware in your config.ru: require "clogger" use Clogger, :format => Clogger::Format::Combined, :logger => File.open("/path/to/log", "ab") run YourApplication.new If you're using Rails 2.3.x or later, in your config/environment.rb somewhere inside the "Rails::Initializer.run do |config|" block: config.middleware.use 'Clogger', :format => Clogger::Format::Combined, :logger => File.open("/path/to/log", "ab") == VARIABLES * $http_* - HTTP request headers (e.g. $http_user_agent) * $sent_http_* - HTTP response headers (e.g. $sent_http_content_length) * $cookie_* - HTTP request cookie (e.g. $cookie_session_id) Rack::Request#cookies must have been used by the underlying application to parse the cookies into a hash. * $request_method - the HTTP request method (e.g. GET, POST, HEAD, ...) * $path_info - path component requested (e.g. /index.html) * $query_string - request query string (not including leading "?") * $request_uri - the URI requested ($path_info?$query_string) * $request - the first line of the HTTP request ($request_method $request_uri $http_version) * $request_time, $request_time{PRECISION} - time taken for request (including response body iteration). PRECISION defaults to 3 (milliseconds) if not specified but may be specified 0(seconds) to 6(microseconds). * $time_local, $time_local{FORMAT} - current local time, FORMAT defaults to "%d/%b/%Y:%H:%M:%S %z" but accepts any strftime(3)-compatible format * $time_utc, $time_utc{FORMAT} - like $time_local, except with UTC * $usec - current time in seconds.microseconds since the Epoch * $msec - current time in seconds.milliseconds since the Epoch * $body_bytes_sent - bytes in the response body (Apache: %B) * $response_length - body_bytes_sent, except "-" instead of "0" (Apache: %b) * $remote_user - HTTP-authenticated user * $remote_addr - IP of the requesting client socket * $ip - X-Forwarded-For request header if available, $remote_addr if not * $pid - process ID of the current process * $e{Thread.current} - Thread processing the request * $e{Actor.current} - Actor processing the request (Revactor or Rubinius) == REQUIREMENTS * Ruby, Rack == DEVELOPMENT The latest development happens in git and is published to the following: git://rubyforge.org/clogger.git git://git.bogomips.org/mirrors/clogger.git You may also browse and download snapshot tarballs: * http://clogger.rubyforge.org/git?p=clogger.git (gitweb) * http://git.bogomips.org/cgit/mirrors/clogger.git (cgit) The mailing list (see below) is central for coordination and development. Patches should always be sent inline (git format-patch -M + git send-email) so we can reply to them inline. == CONTACT All feedback (bug reports, user/development dicussion, patches, pull requests) go to the mailing list. * mailto:clogger@librelist.com Do not send HTML mail or attachments. Do not top post. == INSTALL For all Rubygems users: gem install clogger If you're using MRI 1.8/1.9 and have a build environment, you can also try: gem install clogger_ext If you do not use Rubygems, you may also use setup.rb from tarballs from the Rubyforge project page: * http://rubyforge.org/frs/?group_id=8896 == LICENSE Copyright (C) 2009 Eric Wong and contributors. Clogger is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, version 3.0. Clogger is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with Clogger; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 -- Eric Wong