Return-Path: X-Original-To: apmail-karaf-dev-archive@minotaur.apache.org Delivered-To: apmail-karaf-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 5A0A217220 for ; Mon, 9 Mar 2015 11:16:08 +0000 (UTC) Received: (qmail 5423 invoked by uid 500); 9 Mar 2015 11:16:08 -0000 Delivered-To: apmail-karaf-dev-archive@karaf.apache.org Received: (qmail 5380 invoked by uid 500); 9 Mar 2015 11:16:08 -0000 Mailing-List: contact dev-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@karaf.apache.org Delivered-To: mailing list dev@karaf.apache.org Received: (qmail 5333 invoked by uid 99); 9 Mar 2015 11:16:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Mar 2015 11:16:07 +0000 X-ASF-Spam-Status: No, hits=-0.5 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of cschneider111@gmail.com designates 74.125.82.174 as permitted sender) Received: from [74.125.82.174] (HELO mail-we0-f174.google.com) (74.125.82.174) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Mar 2015 11:16:03 +0000 Received: by wesw55 with SMTP id w55so20148940wes.3 for ; Mon, 09 Mar 2015 04:15:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=N8sZUYRPwsEiCuxblRLYtHx54sfEVU1No2G93m8iTZw=; b=PM4sXG5eFpjUa5CuKL8ySHHlVTpBzCRSQCA5xbY28pOflMBjdV041VUhQCCzRA0gzZ 8JrNRNyJ+L2dj405yY1s8H2iFGcij97DdGoj7BN6h8JhuxUPryujjFMKtsCjmqpbKiCN HPE0+8hgJR5sIx9FuZT+NsJPnzIn6Zy8/+OSvOpnDezYh5XWc0l2jNC8Rq2b5v4n06Wj 7zzKWa5tHXAduDMNFHJxUTfQQyzxIEynAMcWBuvqFPhw7dS+eaA+Bpe6PFvRSSLJhubD FZ8xaoHozX9PidcCxtX4JiAYdz8LX7qWvC3giadG5JmOPbMYWYMw1cLSSg++NFRQSCb4 QprQ== X-Received: by 10.180.240.171 with SMTP id wb11mr41710106wic.11.1425899742188; Mon, 09 Mar 2015 04:15:42 -0700 (PDT) Received: from [192.168.0.111] (HSI-KBW-46-223-17-135.hsi.kabel-badenwuerttemberg.de. [46.223.17.135]) by mx.google.com with ESMTPSA id p10sm27788424wjw.44.2015.03.09.04.15.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Mar 2015 04:15:41 -0700 (PDT) Sender: Christian Schneider Message-ID: <54FD80DD.1040204@die-schneider.net> Date: Mon, 09 Mar 2015 12:15:41 +0100 From: Christian Schneider User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: dev@karaf.apache.org Subject: Re: Some ideas for decanter References: <54FD6BC9.9090407@die-schneider.net> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Some answers inline: On 09.03.2015 11:32, Achim Nierbeck wrote: > Hi Christian, > > please find my comments inline: > > > 2015-03-09 10:45 GMT+01:00 Christian Schneider : > 1. Structure of the Appender data > I think the structure of the Appender data is a bit awkward: > Map> data > This means that we can not transport data if it happens at the same Date > which in practice could happen. So if we need several events we should > rather use Collection> > I am not sure if we really need several events in one call. The Appenders > could do this internally so I would rather have the data be just a simple > Map > > which appender did you look at? > The JMX appender is approprate and the timestamp is collected by the > elasticsearch trigger/appender transformed to the required timestamp field > (take a look at the changes I did) The JMX Appender uses System.currentTimeMillis() as key for the outer map. So a second event may be created with the same time if the system is fast. I think this is broken and the problem is in the Appender API not your implementation. > > >> 2. Use of the EventAdmin service >> If we just need to transport a Map then why not simply use the OSGi >> EventAdmin. It transports a Map on a topic. The topic is >> even very similar to logging categories. >> EventAdmin is standardized so we do not have to invent a new interface. An >> appender would then simply subscribe to a topic and process the Events. >> A collector would simply create and send EventAdmin events. >> The EventAdmin already provides a nice implementation of the Dispatcher. >> >> > I'd rather stick to the JMX appender as the current default one and would > make sure the others do log accordingly. There is no JMX appender. What are you talking about? My proposal is to connect the Collectors and the Appenders using EventAdmin instead of a custom interface that looks almost like EventAdmin. Except that EventAdmin has a topic name which also would make sense for us. It has nothing to do with JMX. > > >> 3. Logging of MDC data >> The current appender.log does not add the mdc Map to the log data. I plan >> to add this to better cover the business logging requirement. One question >> here is of we should rather flatten the MDC values using a prefix on the >> key or rather put the whole MDC map into the data map under one key "mdc". >> At least elastic search can process such nested maps. >> >> > make sure the stuff looks similar to the changes I did with the JMX > appender. So you mean the change with adding the attributes as a map into one value. Yes that is how I also thought to do it for the MDC. >> 4. How to send to elastic search. >> The current appender.elasticsearch uses the elasticsearch API. I propose >> to use JestClient instead. JestClient uses the HttpRest interface of >> elastic search and can also be configured for Authentication. It should >> have a smaller footprint then full elastic search. >> >> > it's the one used for the internal one and does work appropriate. If the > elastic search is external a logging appender with the standard ELK stack > (elasticsearch, logstash, kibana) should be sufficient. I am talking about how to send data to elastic search. Of course I could use logstash but why would I need decanter then? I think we should provide an appender that can be used in production. If the elastic search one can not do any authentication then I would not recommend to use it. Jest at least announces that it can be secured and can talk to elasticsearch. I did a small prototype and it looks good. If we can not agree on jest then maybe we could at least have an additional Jest appender. So people can choose. >> 5. The decanter feature is version 1.3 of the xsd and seems to fail in >> karaf < 4 >> So I propose to use the older feature definition to make sure we can also >> cover at least karaf 3. >> >> > worked like a charm for me on Karaf 4. I would like it to work in karaf 3 and 4. Of course it works on karaf 4. Christian -- Christian Schneider http://www.liquid-reality.de Open Source Architect http://www.talend.com