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 332A411986 for ; Fri, 1 Aug 2014 03:31:23 +0000 (UTC) Received: (qmail 62632 invoked by uid 500); 1 Aug 2014 03:31:22 -0000 Delivered-To: apmail-logging-log4j-user-archive@logging.apache.org Received: (qmail 62575 invoked by uid 500); 1 Aug 2014 03:31:22 -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 62558 invoked by uid 99); 1 Aug 2014 03:31:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Aug 2014 03:31:22 +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 (athena.apache.org: domain of cguillaume@hotpads.com designates 209.85.213.45 as permitted sender) Received: from [209.85.213.45] (HELO mail-yh0-f45.google.com) (209.85.213.45) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Aug 2014 03:31:18 +0000 Received: by mail-yh0-f45.google.com with SMTP id 29so2229141yhl.18 for ; Thu, 31 Jul 2014 20:30:56 -0700 (PDT) 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:date :message-id:subject:from:to:content-type; bh=Z2sJt8YW75sSFWuIzbtyaFED2FS4nZNB8qeLmpUaX58=; b=IlxcKSkpPBffsMsV+pGp/fj8LdKsDn+WPiHB+AYBkb7ZNSrCIHhgrXDtgMLYrtg2UN C1d4DhuVdqRXpV6whzqM6mSomFifeDTTMg/7UICe5Qo3SDLj//WCMBv10fHqiXalYA0W 04g3DrExjQtWTwsiI0geIcfMTB3Ynwz4NcreAlJibUXz8amtiYBVD4CKG+qPyKRXJGnH qD/LmK0RBKk0DHUAEYiiZvLHZCoC31o0YM5swxD5ZVBsQ8NxW3PUHaKKqThXbS2xIoZX IZ+L/3mTltIGdOR1e0D53nEii+utKbS5rwVOhY/VoBECDtHv7KkKP7akHGVHJZe6ZKuM b9iQ== X-Gm-Message-State: ALoCoQnBMWpeMdEg03EKNW0ckCfrT8fp0Sbu6ejOa06dr39tmENOayEn7wc7xcCoiHLehx0iZlRm MIME-Version: 1.0 X-Received: by 10.236.92.108 with SMTP id i72mr3900298yhf.36.1406863856413; Thu, 31 Jul 2014 20:30:56 -0700 (PDT) Received: by 10.170.187.7 with HTTP; Thu, 31 Jul 2014 20:30:56 -0700 (PDT) In-Reply-To: References: <3F4D9A2E-728F-43F0-B6F2-EBEB5210B4D0@gmail.com> Date: Thu, 31 Jul 2014 20:30:56 -0700 Message-ID: Subject: Re: Custom ConfigurationFactory not loaded From: =?UTF-8?Q?Cl=C3=A9ment_Guillaume?= To: Log4J Users List Content-Type: multipart/alternative; boundary=20cf3010ed6368bf2404ff890462 X-Virus-Checked: Checked by ClamAV on apache.org --20cf3010ed6368bf2404ff890462 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable What is the equivalent properties file, considering that I use a custom file format and a custom parser ? Cl=C3=A9ment On Thu, Jul 31, 2014 at 7:37 PM, Matt Sicker wrote: > I think you may still need to set the system property (or equivalent > properties file) to override the default ConfigurationFactory. > > > On 31 July 2014 21:34, Cl=C3=A9ment Guillaume wr= ote: > > > Oh ! I did this because of the documentation available here: > > > > > http://logging.apache.org/log4j/2.x/manual/extending.html#ConfigurationFa= ctory > > > > The second method is by defining the ConfigurationFactory as a Plugin. > > > > > > And why all others ConfigurationFactories are declared as @Plugin ? > > > > @Plugin(name =3D "JsonConfigurationFactory", category =3D > > > "ConfigurationFactory") > > > > @Order(6) > > > > public class JsonConfigurationFactory extends ConfigurationFactory { > > > > > > And what should be the proper way to have a custom Configuration based > on a > > custom file format ? > > > > Regards, > > > > Cl=C3=A9ment > > > > > > On Thu, Jul 31, 2014 at 7:04 PM, Remko Popma > > wrote: > > > > > The configuration factory is responsible for parsing a config file an= d > > > creating a Configuration object. As such, it must exist _before_ the > > > configuration file is processed. > > > > > > Log4j plugins are only created during processing of the config file. > So a > > > configuration factory cannot be a plugin. > > > > > > Best regards, > > > Remko > > > > > > Sent from my iPhone > > > > > > > On 2014/08/01, at 10:18, Cl=C3=A9ment Guillaume > > > wrote: > > > > > > > > Hi, > > > > > > > > I'm trying to use a custom ConfigurationFactory. I created and > > annotated > > > it > > > > with a @Plugin and an @Order like this: > > > > > > > > @Plugin(category =3D "ConfigurationFactory", name =3D > > > > "StartupConfigurationFactory") > > > > @Order(10) > > > > public class StartupConfigurationFactory extends > ConfigurationFactory{ > > > > ... > > > > } > > > > > > > > But it is never loaded (none of the 2 methods are called). > > > > > > > > If I specify the system property "log4j.configurationFactory" with > the > > > name > > > > of my class before creating a logger, my factory is successfully > > loaded. > > > > > > > > Did I made a mistake declaring my ConfigurationFactory ? > > > > > > > > Cl=C3=A9ment > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org > > > For additional commands, e-mail: log4j-user-help@logging.apache.org > > > > > > > > > > > > -- > Matt Sicker > --20cf3010ed6368bf2404ff890462--