Return-Path: X-Original-To: apmail-httpd-modules-dev-archive@minotaur.apache.org Delivered-To: apmail-httpd-modules-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E7605CC14 for ; Sun, 1 Jul 2012 17:27:44 +0000 (UTC) Received: (qmail 92578 invoked by uid 500); 1 Jul 2012 17:27:44 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 92541 invoked by uid 500); 1 Jul 2012 17:27:44 -0000 Mailing-List: contact modules-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: modules-dev@httpd.apache.org Delivered-To: mailing list modules-dev@httpd.apache.org Received: (qmail 92533 invoked by uid 99); 1 Jul 2012 17:27:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Jul 2012 17:27:44 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jlewis@silverhawk.net designates 209.85.214.173 as permitted sender) Received: from [209.85.214.173] (HELO mail-ob0-f173.google.com) (209.85.214.173) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Jul 2012 17:27:36 +0000 Received: by obbta14 with SMTP id ta14so9662274obb.18 for ; Sun, 01 Jul 2012 10:27:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:content-type:x-gm-message-state; bh=WqZkoIKwvwVgstebdkIv0y43qSDm0HVLz5ROqWTFZcA=; b=Ua7EEKvfPbHan8VSeEmKwb5C/gMEBf2BveY6AkkrWdXLqltEu2a2YI132ctVaqXDz3 xJD3N8iLm7pqGU3Bl2yAE4kOPWuES4uu0HXNsfbJ8Qzi4/CKePbMkfrvBXYo2RgSU9BQ 2e+iUYdPGcemJ0ryriF+v4/D2pHx7/8+T23WB9fyfYoCWb14HfOp2I68CsmpcNan/2IF zeY9BWlN2VeKAAGuoZQkEXVL4CQ2NsI9hq8Hp7x7SoUuG/hCgOTSCFBVKZCS1tyK9zmO QtdHolx1WRMbeo49U8xmwhuRE6YmDfM6Oi5TyYo05U+z44GHZU34+QjTr/07VdwdDyY1 z+KQ== MIME-Version: 1.0 Received: by 10.60.172.143 with SMTP id bc15mr10193459oec.73.1341163635590; Sun, 01 Jul 2012 10:27:15 -0700 (PDT) Received: by 10.76.20.147 with HTTP; Sun, 1 Jul 2012 10:27:15 -0700 (PDT) X-Originating-IP: [174.232.193.126] Received: by 10.76.20.147 with HTTP; Sun, 1 Jul 2012 10:27:15 -0700 (PDT) In-Reply-To: <20120701125552.Q6XXP.329425.imail@eastrmwml108> References: <20120701124320.ZEO4T.329306.imail@eastrmwml108> <20120701125552.Q6XXP.329425.imail@eastrmwml108> Date: Sun, 1 Jul 2012 11:27:15 -0600 Message-ID: Subject: Re: "Best practices" or recommendations for logging from a module? From: Joe Lewis To: modules-dev@httpd.apache.org Content-Type: multipart/alternative; boundary=bcaec54c527c15c6a904c3c7fe52 X-Gm-Message-State: ALoCoQnqToNT6pJIHdjjGUmctZEBd5l9nLoUdeNH016Uel4eiks05XvpF+wy9J41srcytx5M1cJn X-Virus-Checked: Checked by ClamAV on apache.org --bcaec54c527c15c6a904c3c7fe52 Content-Type: text/plain; charset=ISO-8859-1 Jim, you could use the log_error funtion all the time. Log_perror javits logging associated with a pool, and log_rerror is for requests. If possible, use log_rerror, because it puts the up address, etc into the logs. Joe On Jul 1, 2012 10:56 AM, wrote: > > ---- ohaya@cox.net wrote: > > Hi, > > > > I'm working on my 1st module, and everything seems to be working so far. > At this point, since it's a first module, and I've been doing lots of > debugging, mostly running Apache in single process mode (-k start -X), I've > only been using printf to output various things. > > > > I am somewhat loath to remove some of the printf output, esp. since my > module is still pretty raw (though working), but I'm starting to look into > how I can switch from using printf to whatever is "normally" used for > logging output from Apache modules. > > > > Given that I don't want to completely remove the ability to output the > debug output, is there a best practice for logging from an Apache module? > Is it just to use the apr logging calls, and set the level to debug? > > > > Thanks, > > Jim > > > > > > > > > > > Hi, > > Also, I guess that, other than the functions take different parameters, I > don't quite "get" why there are 4(?) different log functions > (apr_log_error(), apr_log_rerror(), etc.). Can I just use one of them all > the time, e.g., apr_log_error()? > > Jim > --bcaec54c527c15c6a904c3c7fe52--