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 E0A729F8A for ; Sun, 1 Jul 2012 19:33:57 +0000 (UTC) Received: (qmail 21225 invoked by uid 500); 1 Jul 2012 19:33:57 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 21198 invoked by uid 500); 1 Jul 2012 19:33:57 -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 21189 invoked by uid 99); 1 Jul 2012 19:33:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Jul 2012 19:33:57 +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 jlewis@silverhawk.net designates 209.85.160.45 as permitted sender) Received: from [209.85.160.45] (HELO mail-pb0-f45.google.com) (209.85.160.45) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Jul 2012 19:33:49 +0000 Received: by pbbro12 with SMTP id ro12so8141357pbb.18 for ; Sun, 01 Jul 2012 12:33:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=u8OJ4IInsy7TiyPWUf20zey08P8TZ6mbYgZBpWswYFs=; b=CosG9t/9oC0Gl8aIG/aL19VyVV8Dhq6vCkUFU2sqXD8IPOoElit8Ym6SPShsUOjjOp IrLP8Y00jzhtVkeAXzCeXNqEOWSE4+4YUalj3D1y5eceHLI4iRoLy3Q9gzJVFH614gc5 8hZ1B7hWBIj2KqWs0MrMcz1TeiGVA31DSm2PiH9x4T0/alZtQ5NhsYzzSqaylWOMrpE0 8rdXF54DZQn4XRBMPsfCyzqExaxuMMHvqF25CUmsK3ZHU5udximkSd/2TBrfHat/syJj RBdeiNSmqhVyR34ndYunLfS7c0zwO5QpxD3PIR0VA2i6JwtKVxORbVXmTJPVCL7fAZUs 74sg== Received: by 10.66.80.199 with SMTP id t7mr15977789pax.82.1341171207531; Sun, 01 Jul 2012 12:33:27 -0700 (PDT) Received: from ruby.cottonwoodheights.silverhawk.net (cottonwoodheights.silverhawk.net. [63.226.93.31]) by mx.google.com with ESMTPS id rd7sm11090930pbc.70.2012.07.01.12.33.26 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 01 Jul 2012 12:33:26 -0700 (PDT) Sender: Joe Lewis Message-ID: <4FF0A5F2.8030907@joe-lewis.com> Date: Sun, 01 Jul 2012 13:33:06 -0600 From: Joe Lewis User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-2.fc11 Thunderbird/3.0.4 MIME-Version: 1.0 To: modules-dev@httpd.apache.org Subject: Re: "Best practices" or recommendations for logging from a module? References: <20120701145531.BGYOG.330650.imail@eastrmwml108> In-Reply-To: <20120701145531.BGYOG.330650.imail@eastrmwml108> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQmRqWGDtFOYYvdLEa4JzV8e4tsKWxm4dhpqd30ZuT9bvV5NE79KjXO+nei/WeYHLp9TJ+31 On 07/01/2012 12:55 PM, ohaya@cox.net wrote: > ---- ohaya@cox.net wrote: > >> ---- ohaya@cox.net wrote: >> >>> ---- Joe Lewis wrote: >>> >>>> 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: >>>> >>>> >>> >>> Joe, >>> >>> Thanks! >>> >>> Jim >>> >> >> Hi, >> >> Oh, oh :(. >> >> I'm using: >> >> ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, NULL,); >> >> all over the place, and even though I have only one LogLevel in the httpd;conf, at the top level, set to "debug", I don't see those messages. >> >> The only ones I see are the ones that use APLOG_NOTICE. >> >> Why is this? I thought that with LogLevel set to debug, that I should see all level msgs output using ap_log_error? >> >> Thanks, >> Jim >> >> > > Hi, > > I think that I've found out why I'm not seeing those log messages. Apparently, if the server parameter is NULL, only APLOG_NOTICE message appear except for during startup. > > So, I have use a server for that parameter, e.g. r->server, BUT, in some cases, e.g., in a function like the response callback for libcurl, where the signature is pre-defined, and where there is no request_rec or server_rec among the parameters, how can I get ap_log_error to output anything (other than APLOG_NOTICE) messages? > > Thanks, > Jim > Again, if you have access to a request_rec structure, I'd use ap_log_rerror. Otherwise, use ap_log_perror. Those have a better consistency with logging, e.g. : ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, requestrec, "uri = %s",r->uri); ap_log_perror(APLOG_MARK, APLOG_DEBUG, 0, pool, "creating config"); Joe