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 0B381200BC8 for ; Wed, 23 Nov 2016 09:02:05 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 067ED160AFD; Wed, 23 Nov 2016 08:02:05 +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 2BB34160AFA for ; Wed, 23 Nov 2016 09:02:04 +0100 (CET) Received: (qmail 38308 invoked by uid 500); 23 Nov 2016 08:02:03 -0000 Mailing-List: contact dev-help@apex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@apex.apache.org Delivered-To: mailing list dev@apex.apache.org Received: (qmail 38282 invoked by uid 99); 23 Nov 2016 08:02:02 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Nov 2016 08:02:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 7C9721A9D34 for ; Wed, 23 Nov 2016 08:02:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.48 X-Spam-Level: ** X-Spam-Status: No, score=2.48 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=datatorrent-com.20150623.gappssmtp.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id QsMLPAK3T-TN for ; Wed, 23 Nov 2016 08:01:58 +0000 (UTC) Received: from mail-oi0-f45.google.com (mail-oi0-f45.google.com [209.85.218.45]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id D62EB5F39A for ; Wed, 23 Nov 2016 08:01:57 +0000 (UTC) Received: by mail-oi0-f45.google.com with SMTP id w63so6197934oiw.0 for ; Wed, 23 Nov 2016 00:01:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datatorrent-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=wZBMDzMjpSDKwufZopQjaHt5AVtRKrwJOF+Z1OASSpI=; b=OlaB6WpCE2K12kNrSLV0iuskVe1KdzBT1FLbeMIIz4ywj+QiFLogrOHYXgTugo09nw 1WqJoS8WZe8IpRZTxOsj+ugHS3ujBu/ClKK9xmt5am47fxubisw/oHeuroeG5GfUucrw EFubfNYWkxSHlb3FWjHhjnCfqKhdT176LAEtmSJWLs7ya59zws4L4HEQvSe+7VoyeSvl lo8QUQcZD9pG31uSD2ZrYMA85odRdFxXezS8BEihD57zsNlKE8UgcjIPhUehSd4eJWHY +22pLwMoLF7wCfFuZPOdLYhTcTSLO6uovw29s4P1X368hTZxB3m2vD9rGafv9OOBVblF nmDw== 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=wZBMDzMjpSDKwufZopQjaHt5AVtRKrwJOF+Z1OASSpI=; b=DWs3Z6aS70l2QFWPdsJQDcRROkQuqG56K/doJvzPkbAFQxS1W+C6TjUyKl4gb9lbYm evhFXf7fmsChyi9XM2FMIKDLSDcFnjoZBUxW3Dl2fyLSeHOvPconUXIDJVTUmtpHYYsl mWuZ4ZCp6yDbgF0GtiogQtsKeLFbZWDW4VlM3S56KkoSbwGWIHFfGEjVW8HO4vF/Dz28 q5N94g6JdasNhf/+534Rj8kpWjkyL3bvtksqeb2pfJasyKaAgQjsVZhG3y3qA7vB4/Q1 5WNRKfDsHaP4EstkbN7gj1rn/162PUO8ym+Rz32aammnQrWdtbf96eaAB4d27h/2M95V INCw== X-Gm-Message-State: AKaTC00Ry4AYOh1xAL5lxyndRT4eJTIWs7UViCKLbNWRVV/6XZQgrLi73EoPy92FZsgd5fzwxKtlI/P/QdChnaBT X-Received: by 10.157.46.5 with SMTP id q5mr1101904otb.46.1479888115915; Wed, 23 Nov 2016 00:01:55 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.15.228 with HTTP; Wed, 23 Nov 2016 00:01:55 -0800 (PST) In-Reply-To: References: <5A1733A7-5107-45FE-867B-FA815A586902@datatorrent.com> From: Mohit Jotwani Date: Wed, 23 Nov 2016 13:31:55 +0530 Message-ID: Subject: Re: Adding new log4j appender to Apex core To: dev Content-Type: multipart/alternative; boundary=001a1146378274f98a0541f34d70 archived-at: Wed, 23 Nov 2016 08:02:05 -0000 --001a1146378274f98a0541f34d70 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable +1 - Approach 2 Regards, Mohit On Wed, Nov 23, 2016 at 12:35 PM, AJAY GUPTA wrote: > +1 for approach 2. > > > Regards, > Ajay > > On Wed, Nov 23, 2016 at 12:16 PM, David Yan wrote= : > > > The goal of this log4j appender is to provide a log offset and the fixe= d > > name of the container log file (instead of apex.log becoming apex.log.1 > and > > then apex.log.2, etc due to rotation) as part of an error STRAM event s= o > > users can easily locate the log entries around the error. > > > > The user can override the appender, but in that case, the engine detect= s > > that and will not include the log location as part of the STRAM event. > > > > David > > > > On Tue, Nov 22, 2016 at 7:10 PM, Priyanka Gugale < > priyanka@datatorrent.com > > > > > wrote: > > > > > Hi, > > > > > > Thomas, > > > Yes log4j is ultimately owned by user, and they should be able to > > override > > > it. What I am trying to do is provide a default behavior for Apex. In > > case > > > user isn't using any logger of their own we should use this new > appender > > of > > > Apex rather than using standard log4j appender as per hadoop config. > > > > > > Sanjay, > > > Archetype is the good place to put this and I will add it there, but > many > > > time people won't use it. So I wanted to keep it at ~/.dt as well. Is > > there > > > any other default config folder for Apex? > > > > > > Also I am not relying on anything. If we fail to find config in app j= ar > > or > > > ~/.dt we are going to skip usage of this new appender. > > > > > > -Priyanka > > > > > > On Wed, Nov 23, 2016 at 5:58 AM, Sanjay Pujare > > > > wrote: > > > > > > > The only way to =E2=80=9Cenforce=E2=80=9D this new appender is to u= pdate the > archetypes > > > > (apex-app-archetype and apex-conf-archetype under apex-core/ ) to > use > > > the > > > > new ones as default. But there does not seem to be a way to enforce > > this > > > > for anyone not using the archetypes. > > > > > > > > I agree with not relying on ~/.dt in apex-core. > > > > > > > > On 11/22/16, 1:08 PM, "Thomas Weise" wrote: > > > > > > > > The log4j configuration is ultimately owned by the user, so how > do > > > you > > > > want > > > > to enforce a custom appender? > > > > > > > > I don't think that this should rely on anything in ~/.dt either > > > > > > > > Thomas > > > > > > > > On Tue, Nov 22, 2016 at 10:00 AM, Priyanka Gugale < > > > > priyanka@datatorrent.com> > > > > wrote: > > > > > > > > > Hi, > > > > > > > > > > I am working on APEXCORE-563 > > > > > > > > > > As per this Jira we should put log file name in > > container/operator > > > > events. > > > > > The problem is current RollingFileAppender keeps renaming fil= es > > > from > > > > 1 to 2 > > > > > to ... n as files reach maximum allowed file size. Because of > > > > constant > > > > > renaming of files we can't put a fixed file name in stram > event. > > > > > > > > > > To overcome this I would like to add a new log4j appender to > > > > ApexCore. > > > > > There are two ways I can implement this: > > > > > 1. Have Daily rolling file appender. The current file will be > > > > recognized > > > > > based on timestamp in file name. Also to control max file siz= e, > > we > > > > need to > > > > > keep rolling files based on size as well. > > > > > 2. Have Rolling File Appender but do not rename files. When m= ax > > > file > > > > size > > > > > is reached create new file with next number e.g. crate log fi= le > > > > dt.log.2 > > > > > after dt.log.1 is full. Also to recognize the latest file kee= p > > the > > > > softlink > > > > > named dt.log pointing to current log file. > > > > > > > > > > I would prefer to implement approach 2. Please provide your > > > > > comments/feedback if you feel otherwise. > > > > > > > > > > Also to use this new appender we need to use our custom > > > > log4j.properties > > > > > file instead of one present in hadoop conf. For that we need = to > > set > > > > jvm > > > > > option -Dlog4j.configuration. I am planning to update file > > > > dt-site.xml in > > > > > folder ~/.dt and default properties file available in apex > > > > archetype to > > > > > set jvm options as follows: > > > > > > > > > > dt.attr.CONTAINER_JVM_OPTIONS > > > > > -Dlog4j.configuration=3Dlog4j.props > > > > > > > > > > > > > > > And I will copy log4j.props file in ~/.dt folder as well as > > > > > apex-archetypes. > > > > > > > > > > Lastly if someone still miss this new log4j properties file o= r > > jvm > > > > option > > > > > to set -Dlog4j.configuration we will not put log file name in > > event > > > > raised > > > > > by container or operator. > > > > > > > > > > Please provide your feedback on this approach. > > > > > > > > > > -Priyanka > > > > > > > > > > > > > > > > > > > > > > > > > > > --001a1146378274f98a0541f34d70--