Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A3744200B6F for ; Wed, 24 Aug 2016 21:26:55 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9C5B7160AC2; Wed, 24 Aug 2016 19:26:35 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 97A6C160A91 for ; Wed, 24 Aug 2016 21:26:34 +0200 (CEST) Received: (qmail 28956 invoked by uid 500); 24 Aug 2016 19:26:28 -0000 Mailing-List: contact users-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@groovy.apache.org Delivered-To: mailing list users@groovy.apache.org Received: (qmail 28946 invoked by uid 99); 24 Aug 2016 19:26:28 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Aug 2016 19:26:28 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 56FBDC2FAC for ; Wed, 24 Aug 2016 19:26:28 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.189 X-Spam-Level: * X-Spam-Status: No, score=1.189 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, T_REMOTE_IMAGE=0.01] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id G-ErZDRUGyYU for ; Wed, 24 Aug 2016 19:26:26 +0000 (UTC) Received: from mail-qk0-f178.google.com (mail-qk0-f178.google.com [209.85.220.178]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 459155F54E for ; Wed, 24 Aug 2016 19:26:25 +0000 (UTC) Received: by mail-qk0-f178.google.com with SMTP id z190so25293899qkc.0 for ; Wed, 24 Aug 2016 12:26:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=k4ph78oCesEcvyBcsc0sow0VFrAZIqLe0Jy7mx+on+s=; b=qwodnDj155vJaRF3LfBRu1kUKXbg6sndMIola+XOlCDNr94ZYlv54XwmpBr7tzFt5f Aj326fXOtgVHDGbeqUXWyY5yYdzsf0xq+jAhdo0b28PWijQLItlc3+ur44jGa2/du4sI I5uXOn9qnaY2P1q5HrD0Hv5q7Q60rcfAzrVWJWDfwVQbci1BbuhaLFUaOmCAc1nH33X9 BcEkwwv/+MmWMPUfCqdGFpe4c9uL2fZx5xynoH3CBfYJPW8xJPj2ipP/rzfTp/WjqC+9 BBlJH+BMrnnHf//5mb9FImGY3yE4YX+p0AdtTEog0iU+VHa0FaTtoZXyMEWfvC9eRUHL rIDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=k4ph78oCesEcvyBcsc0sow0VFrAZIqLe0Jy7mx+on+s=; b=j7nlKKALeNoheTr0mTjoMdyx65ktBZ770CEElq/RvwaTnsA8IqKzThNH7eDTfPAMT1 R9/SWPO30FCltlbmAx2vAtRp/cCLyCDd9595WlPCguZItczWmTz3z7AL+jxmID1WLMAG dwIZWlPK9XQUaeRybSd27gVHBOC5xzSDMCHwoKT2/oz5PV5kb4sA2JZBshmcfdhpGhlA SaPten6vTX+jkVrRQjjq/DPzF4I1hkfJBkPdXZ4RZkVZbBUuFD76Kv6eo2WSlRG1AEX0 5LgeudYq8zjbkUPkx8E2WPSR+ud25Qw1MzcjVKI8mV3GHCmw39MuHhL7psB41iP/6t+0 3SSQ== X-Gm-Message-State: AE9vXwP/ix0cZvblHhxPVci9B/tvIUGhxMfsu46p2nPhVAn38t0KzS8f0hSP5m5yuJZJ4PE2xIl/4UKXLo3RQw== X-Received: by 10.55.36.131 with SMTP id k3mr5507322qkk.86.1472066784102; Wed, 24 Aug 2016 12:26:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.55.136.134 with HTTP; Wed, 24 Aug 2016 12:26:03 -0700 (PDT) In-Reply-To: References: From: Raviteja Lokineni Date: Wed, 24 Aug 2016 15:26:03 -0400 Message-ID: Subject: Re: Reporting groovy line number in log4j2 To: users@groovy.apache.org Content-Type: multipart/alternative; boundary=001a114533eac0b6de053ad641c9 archived-at: Wed, 24 Aug 2016 19:26:55 -0000 --001a114533eac0b6de053ad641c9 Content-Type: text/plain; charset=UTF-8 Just a question out of the blue. Exceptions reported in Groovy seems to report the correct line number, what's wrong with line number logger uses? On Wed, Aug 24, 2016 at 2:36 PM, Raviteja Lokineni < raviteja.lokineni@gmail.com> wrote: > I have added logging(log4j2) in a groovy class which has the following > pseudo code: > > This returns line number -1: > GParsPool.withPool { > .eachParallel { > //do something > log.debug("") > } > } > > The following also returns -1, although this doesn't seem to be in any > closure: > private void doProcess() { > log.debug("") > } > > I take my word on grails back. It also returns -1 for line number. > Grails Example: > > package com.sample > > class SampleController { > > def index() { > log.error("test") > render "test" > } > } > > > ERROR grails.app.controllers.com.sample.SampleController > g.a.c.com.sample.SampleController.call(-1) - test > > Thanks, > Raviteja > > On Mon, Aug 22, 2016 at 4:40 PM, Paul King wrote: > >> We set the line number to -1 for generated code which doesn't have a >> corresponding real line in the source code. >> >> So, you might be seeing exactly what we expect or it's possible we have >> missed some case. Can you elaborate further on how you are using the >> logging? >> >> Cheers, Paul. >> >> On Tue, Aug 23, 2016 at 6:00 AM, Raviteja Lokineni < >> raviteja.lokineni@gmail.com> wrote: >> >>> Hi all, >>> >>> Log4j ouputs groovy class line number to be -1. Any known fix/workaround >>> for this issue? I looked around a bit but found nothing. FYI, Grails team >>> doesn't seem to have this issue. >>> >>> Log4j patern: %d{yyyy-MM-dd HH:mm:ss.SSS(XXX)} [%t] %p %c:%L - %m%n >>> >>> Sample output I get: >>>