Return-Path: X-Original-To: apmail-logging-log4j-user-archive@www.apache.org Delivered-To: apmail-logging-log4j-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 66DF910B18 for ; Sat, 8 Mar 2014 10:58:41 +0000 (UTC) Received: (qmail 23425 invoked by uid 500); 8 Mar 2014 10:58:41 -0000 Delivered-To: apmail-logging-log4j-user-archive@logging.apache.org Received: (qmail 22802 invoked by uid 500); 8 Mar 2014 10:58:28 -0000 Mailing-List: contact log4j-user-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Log4J Users List" Reply-To: "Log4J Users List" Delivered-To: mailing list log4j-user@logging.apache.org Received: (qmail 22793 invoked by uid 99); 8 Mar 2014 10:58:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 08 Mar 2014 10:58:24 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of nicolas.baer@gmail.com designates 209.85.216.43 as permitted sender) Received: from [209.85.216.43] (HELO mail-qa0-f43.google.com) (209.85.216.43) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 08 Mar 2014 10:58:18 +0000 Received: by mail-qa0-f43.google.com with SMTP id j15so5155806qaq.30 for ; Sat, 08 Mar 2014 02:57:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=zAVGB4FcKR99RqfA9rI1tuIU2f3/svojY82DEd6s58g=; b=O3fIXM0jRR90cz4gzwRVASQveBHkIF0duQWm+8FspYflbd0R7w6pIAGAH6vnNlhBmc FxMdHImSKN+jyK21ZcOFC5iklzwT5Uk4Z8pB+RLGDPik0KwdQpiWb62hRTVhDMQ3Ey3y PhsbL9WmUmX6Nl5hinQ2v1r4yv5SjaJX45LHFUSU8t9dYPJ72I0LF+QG1OjyccJXzdLg f9yaRKv/9cj50RIm39ukLC9jI7vV/Joct6C45Qsn2247v3MP+wWLk044V2oAA6plKLcb B8+QHhyxNAfgSC5mqPwPuom07fmSHZ63tz2aZYyNVgIcnTNzdEs9u91N1QbAaZeJBO2k 1ifQ== MIME-Version: 1.0 X-Received: by 10.140.107.10 with SMTP id g10mr23302587qgf.63.1394276277496; Sat, 08 Mar 2014 02:57:57 -0800 (PST) Received: by 10.96.5.8 with HTTP; Sat, 8 Mar 2014 02:57:57 -0800 (PST) In-Reply-To: References: Date: Sat, 8 Mar 2014 11:57:57 +0100 Message-ID: Subject: Re: Log4j2 Custom Layout Flume Appender From: =?ISO-8859-1?Q?Nicolas_B=E4r?= To: Log4J Users List Content-Type: multipart/alternative; boundary=001a113a6c1e3d9c8004f4163e53 X-Virus-Checked: Checked by ClamAV on apache.org --001a113a6c1e3d9c8004f4163e53 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Specifying the package name in the packages attribute of the configuration element did the trick. Thanks! Nicolas On Fri, Mar 7, 2014 at 5:10 PM, Ralph Goers wro= te: > You made your layout a plugin? If so, make sure you specify its package > name in the packages attribute of the configuration element. Then specif= y > > > > Where MyLayout is the name you gave your Layout plugin and attr1 and attr= 2 > are attributes you defined for the layout. > > Log4j 2 uses plugins so you never specify the name of the class in the > configuration. > > Ralph > > On Mar 7, 2014, at 5:22 AM, Nicolas B=E4r wrote: > > > Hi > > > > I'm trying to use Log4j2 to send certain log messages to Apache Flume. > > Flume should then push the messages to Elasticsearch in order to analyz= e > > the data with Kibana. The setup works fine using the JSONLayout, but th= is > > layout does not provide enough flexibility for my use case. Currently t= he > > message is saved to Elasticsearch as one field. Therefore I'd like to > > replace the JSONLayout with a custom implementation to extract certain > > fields from the log messages. I followed the instructions on the > following > > page: http://logging.apache.org/log4j/2.x/manual/extending.html#Layouts > > But I'm not able to specify the custom layout in the log4j2.xml file. > > What's the correct syntax to do this? > > > > I tried the tag and specified my custom class in the name > > attribute. This will throw the following error message: ERROR Flume > > contains an invalid element or attribute "layout". > > > > Any help is highly appreciated, thanks. > > > > Best, > > Nicolas > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org > For additional commands, e-mail: log4j-user-help@logging.apache.org > > --001a113a6c1e3d9c8004f4163e53--