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 D95BE200C61 for ; Tue, 11 Apr 2017 01:18:16 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id D7E6A160BA5; Mon, 10 Apr 2017 23:18:16 +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 02281160B99 for ; Tue, 11 Apr 2017 01:18:15 +0200 (CEST) Received: (qmail 53189 invoked by uid 500); 10 Apr 2017 23:18:15 -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 53177 invoked by uid 99); 10 Apr 2017 23:18:14 -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; Mon, 10 Apr 2017 23:18:14 +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 546B81A007D for ; Mon, 10 Apr 2017 23:18:14 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.287 X-Spam-Level: X-Spam-Status: No, score=-0.287 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_H2=-2.796, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001, T_KAM_HTML_FONT_INVALID=0.01] 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-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id ENZmoRCWVG2c for ; Mon, 10 Apr 2017 23:18:11 +0000 (UTC) Received: from mail-io0-f173.google.com (mail-io0-f173.google.com [209.85.223.173]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 1450C5F5CA for ; Mon, 10 Apr 2017 23:18:11 +0000 (UTC) Received: by mail-io0-f173.google.com with SMTP id r16so59619035ioi.2 for ; Mon, 10 Apr 2017 16:18:11 -0700 (PDT) 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=kvLxWReLWbBiv2EAGjYr4tKAvQ2NY6stzwKVIf2CGG4=; b=1TKnR63i52abG8cwit8+6vfQGc5zUjjemFZmG2mdg1dLvJZAF4I6FIzZ5Fp4OD3LJ8 kpIjB6/jZpTFOvDKjP6Nwux95+8bXI+deBJuF1X7GsyHHgiARP4Mz3JoG8Ifx6NYIWpI cJL3HJ0Dr18cFueh7eSuvR1c7UnnZSfEP98gfzG5SMX27EMToST9KzKpo6NYVWDZFb3B 3TVRG6JMj7bR07fJyOtyBZLxyGPIfg/TkVz3W25xED+ul80xk43vQBwS3fwwqmb3NJwI 8hBfP+nCHqx8kpw15RRl+/ZjzYsDV3xNa/DhsIdCjLuZf98piDQDnUn9m0eT0JVez9W+ 4D+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=kvLxWReLWbBiv2EAGjYr4tKAvQ2NY6stzwKVIf2CGG4=; b=qg/jvFpAKJ17vcPvVTGzq4H35F93SxeigBHEiiCALoNMWrE2XjyHwuq7NeUGtLYKEr QqBY8ilRK9ZPCwVv/KTYShxz0rozICzGnREf28r9PWOgEhpvcZfWLiTAjTvKhsExWj7Q kQYAQ1lfi9M/TBL6jGlMXlUqjtgV6WRXaWcGJNDbXsrlwvj5m62r5UQ6MN7WZCaqZain fxpoxfaH24ibjVTcZBS+Mdf2LTbGfvEzf5NLrkwmI/Yeg31V7p0CcAs2sRfW5vIk9HV1 18WQ/jiYJTMLfSwqCc0XeXaTLQ9IFLpCKEq3dGymWcBsVqra/GN0QQi8RgOtwejd7GvD XoNg== X-Gm-Message-State: AN3rC/45+hM+/XY9ODLYWjnvNadM1zJMqLOuazEMaRgzVOOC7APlubNg JMQWj2o+p2F5/y6aV3w+WGRRO3eS/GwNT3k= X-Received: by 10.36.104.20 with SMTP id v20mr13695838itb.86.1491866289784; Mon, 10 Apr 2017 16:18:09 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.147.9 with HTTP; Mon, 10 Apr 2017 16:18:09 -0700 (PDT) In-Reply-To: <5afc31ff-0fb7-0473-f3f7-4b732f829b4b@datatorrent.com> References: <0864a4d6-995f-e636-470c-60c1c43d0621@datatorrent.com> <8e6122f3-8244-a7be-fbaa-0941b4697545@datatorrent.com> <5afc31ff-0fb7-0473-f3f7-4b732f829b4b@datatorrent.com> From: Munagala Ramanath Date: Mon, 10 Apr 2017 16:18:09 -0700 Message-ID: Subject: Re: Programmatic log4j appender in Apex To: dev@apex.apache.org Content-Type: multipart/alternative; boundary=001a113f84da415fea054cd830fe archived-at: Mon, 10 Apr 2017 23:18:17 -0000 --001a113f84da415fea054cd830fe Content-Type: text/plain; charset=UTF-8 http://logging.apache.org/log4j/1.2/faq.html#3.6 Log4j has the ability to dynamically reload changes to the properties file via the *configureAndWatch()* method of *PropertyConfigurator*. If this is already baked in, could devops simply change the properties file if we provide an enhanced set of appenders for the desired use cases ? Ram On Mon, Apr 10, 2017 at 2:04 PM, Vlad Rozov wrote: > It will require application recompilation and repackaging. The proposed > functionality is for dev-ops to be able to route application logging to a > preferred destination without recompiling applications. It is run-time > configuration vs compile time hardcoded appender. > > Thank you, > > Vlad > On 4/10/17 11:23, Munagala Ramanath wrote: > >> You can do it in a trivial derived class without changing the base class. >> >> Ram >> >> On Mon, Apr 10, 2017 at 11:19 AM, Vlad Rozov >> wrote: >> >> Does not the proposal to use Logger.addAppender() requires modifications >>> to used operators code? >>> >>> Thank you, >>> >>> Vlad >>> >>> On 4/10/17 10:58, Munagala Ramanath wrote: >>> >>> People can currently do this by simply implementing the Appender >>>> interface >>>> and adding it >>>> with Logger.addAppender() in the setup method. Why do we need something >>>> more elaborate ? >>>> >>>> Ram >>>> >>>> On Mon, Apr 10, 2017 at 10:30 AM, Sergey Golovko < >>>> sergey@datatorrent.com> >>>> wrote: >>>> >>>> The configuration of a log4j appender via log4j configuration file is a >>>> >>>>> static configuration that cannot be disabled/enabled and managed >>>>> dynamically by an application designer. The programmatic approach will >>>>> allow an application designer to specify which of the available log4j >>>>> appenders should be used for the specific application. >>>>> >>>>> It is not necessary Apex should use the predefined log4j appenders >>>>> only. >>>>> The log4j events contain useful but the very limited number of >>>>> properties >>>>> which values can be printed into output log4j sources. But based on the >>>>> knowledge of the software product workflow, the custom defined log4j >>>>> appender can extend a list of predefined output log events properties >>>>> and, >>>>> for instance for Apex, return: node, user name, application name, >>>>> application id, container id, operator name, etc. >>>>> >>>>> Also the output log events that are generated by a custom defined log4j >>>>> appender can be stored and indexed by any type of a full text search >>>>> database. It will allow the customers and developers to simplify >>>>> collection >>>>> of log events statistics and searching/filtering of specific events for >>>>> debugging and investigation. >>>>> >>>>> Thanks, >>>>> Sergey >>>>> >>>>> >>>>> On Mon, Apr 10, 2017 at 6:34 AM, Vlad Rozov >>>>> wrote: >>>>> >>>>> +1 Apex engine does not own log4j config file - it is provided either >>>>> by >>>>> >>>>>> Hadoop or an application. Hadoop log4j config does not necessarily >>>>>> meet >>>>>> application logging requirements, but if log4j is provided by an >>>>>> application designer, who can only specify what to log, it may not >>>>>> meet >>>>>> operations requirements. Dev-ops should have an ability to specify >>>>>> where >>>>>> >>>>>> to >>>>> >>>>> log depending on the available infrastructure at run-time. >>>>>> >>>>>> It will be good to have an ability not only specify extra log4j >>>>>> appenders >>>>>> at lunch time, but also at run-time, the same way how log4j logger >>>>>> levels >>>>>> may be changed. >>>>>> >>>>>> Thank you, >>>>>> >>>>>> Vlad >>>>>> >>>>>> On 4/9/17 23:14, Priyanka Gugale wrote: >>>>>> >>>>>> We can always write a custom appender and add it by changing root >>>>>> appender >>>>>> in log4j config file. Can you explain how adding appender >>>>>> grammatically >>>>>> >>>>>>> would help? >>>>>>> >>>>>>> -Priyanka >>>>>>> >>>>>>> On Sun, Apr 9, 2017 at 11:50 AM, Sanjay Pujare < >>>>>>> sanjay@datatorrent.com >>>>>>> wrote: >>>>>>> >>>>>>> Please give some examples and/or use cases of this programmatic log4j >>>>>>> >>>>>>> appender. >>>>>>>> >>>>>>>> On Fri, Apr 7, 2017 at 8:40 PM, Sergey Golovko < >>>>>>>> sergey@datatorrent.com >>>>>>>> wrote: >>>>>>>> >>>>>>>> Hi All, >>>>>>>> >>>>>>>> I'd like to add supporting of a custom defined log4j appender that >>>>>>>>> can >>>>>>>>> be >>>>>>>>> added to Apex Application Master and Containers and be configurable >>>>>>>>> programmatically. >>>>>>>>> >>>>>>>>> Sometimes it is not trivial to control log4j configuration via >>>>>>>>> log4j >>>>>>>>> properties. And I think the having of the approach to add a log4j >>>>>>>>> >>>>>>>>> appender >>>>>>>>> >>>>>>>> programmatically will allow the customers and developers to plugin >>>>>>>> their >>>>>>>> >>>>>>> own custom defined log4j appenders and be much flexible for streaming >>>>>> >>>>>>> and >>>>>>>>> collection of Apex log events. >>>>>>>>> >>>>>>>>> I assume to provide generic approach for definition of the >>>>>>>>> >>>>>>>>> programmatic >>>>>>>> >>>>>>> log4j appender and to pass all configuration parameters including a >>>>>> >>>>>>> name >>>>>>>> >>>>>>> of >>>>>> >>>>>>> the Java class with implementation of the log4j appender via system >>>>>>>> >>>>>>>>> and/or >>>>>>>>> >>>>>>>> command line properties. >>>>>>>> >>>>>>>>> Thanks, >>>>>>>>> Sergey >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>> >> > -- _______________________________________________________ Munagala V. Ramanath Software Engineer E: ram@datatorrent.com | M: (408) 331-5034 | Twitter: @UnknownRam www.datatorrent.com | apex.apache.org --001a113f84da415fea054cd830fe--