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 3796CCD31 for ; Fri, 7 Mar 2014 16:11:06 +0000 (UTC) Received: (qmail 60277 invoked by uid 500); 7 Mar 2014 16:11:05 -0000 Delivered-To: apmail-logging-log4j-user-archive@logging.apache.org Received: (qmail 59482 invoked by uid 500); 7 Mar 2014 16:10:56 -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 59354 invoked by uid 99); 7 Mar 2014 16:10:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Mar 2014 16:10:52 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ralph.goers@dslextreme.com designates 209.85.192.169 as permitted sender) Received: from [209.85.192.169] (HELO mail-pd0-f169.google.com) (209.85.192.169) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Mar 2014 16:10:45 +0000 Received: by mail-pd0-f169.google.com with SMTP id fp1so4232711pdb.0 for ; Fri, 07 Mar 2014 08:10:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:content-transfer-encoding:message-id:references:to; bh=LetgpTKxXWOZRlphQUSHBt/UQVxXqNL2lGnNbNVXqJA=; b=WBZgwFFSJFU3D29yFBhXlHmfjlgH3mUWSCrdcdiRZ0f3Zx4bkCS78ofusUVQHtFTzD QLDJvgfRuzYxBquogimbcItNgEFVhw6mf+OZsDZU8ttjG97mS9lr0cL2yDAYvV6JBXTJ 4mT9VPo7AlqJZz/JwwfolBC9ppJ/6glNOf2McGBMYv8A5BI260vZr1uGYwddIPgoWBZ5 oz+e4Nz1Vnx93x7TNZX6FUPl0W/az2g6hiDI59Npv5UojZv018hbjx9Y/OMEM3hrDmj8 yBJu13YxhAxaCHWryXpwFAUAPtWy5CNBt/fnHCPmWNNHmFQwufhweH2rFJ5I3lnAo/YI QWKg== X-Gm-Message-State: ALoCoQmpdvehOqrj7Ebcjp8ZN4i7unwby+b/e+hm0NGNTLn11Hq4XY6pitzpI6ZhsKAK/cYCvKm8 X-Received: by 10.68.40.233 with SMTP id a9mr22917868pbl.68.1394208623466; Fri, 07 Mar 2014 08:10:23 -0800 (PST) Received: from [192.168.1.44] ([209.12.167.2]) by mx.google.com with ESMTPSA id db3sm37343738pbb.10.2014.03.07.08.10.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 07 Mar 2014 08:10:22 -0800 (PST) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: Log4j2 Custom Layout Flume Appender From: Ralph Goers In-Reply-To: Date: Fri, 7 Mar 2014 08:10:20 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Log4J Users List X-Mailer: Apple Mail (2.1874) X-Virus-Checked: Checked by ClamAV on apache.org You made your layout a plugin? If so, make sure you specify its package = name in the packages attribute of the configuration element. Then = specify Where MyLayout is the name you gave your Layout plugin and attr1 and = attr2 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 >=20 > 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 = analyze > the data with Kibana. The setup works fine using the JSONLayout, but = this > layout does not provide enough flexibility for my use case. Currently = the > 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? >=20 > 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". >=20 > Any help is highly appreciated, thanks. >=20 > Best, > Nicolas --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org For additional commands, e-mail: log4j-user-help@logging.apache.org