Return-Path: X-Original-To: apmail-logging-log4j-dev-archive@www.apache.org Delivered-To: apmail-logging-log4j-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 04912114D0 for ; Sun, 8 Jun 2014 22:11:28 +0000 (UTC) Received: (qmail 56661 invoked by uid 500); 8 Jun 2014 22:11:27 -0000 Delivered-To: apmail-logging-log4j-dev-archive@logging.apache.org Received: (qmail 56607 invoked by uid 500); 8 Jun 2014 22:11:27 -0000 Mailing-List: contact log4j-dev-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Log4J Developers List" Reply-To: "Log4J Developers List" Delivered-To: mailing list log4j-dev@logging.apache.org Received: (qmail 56594 invoked by uid 99); 8 Jun 2014 22:11:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Jun 2014 22:11:27 +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 ralph.goers@dslextreme.com designates 209.85.160.53 as permitted sender) Received: from [209.85.160.53] (HELO mail-pb0-f53.google.com) (209.85.160.53) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Jun 2014 22:11:21 +0000 Received: by mail-pb0-f53.google.com with SMTP id md12so4287407pbc.12 for ; Sun, 08 Jun 2014 15:11:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:content-type:message-id:mime-version :subject:date:references:to:in-reply-to; bh=VbIoHhe4dyhU0of8oa5PtomnQpKEB6HKVRpfc9ACwAQ=; b=E63pgDVzzz27dD6YTIqCxIqKFC5WCiX+n9/hLyvDPvUJrpv6LGAlbY1Lh8OyidiHAb qR+FZl75JoGGOcXprsHvaAhnbJqQZ7RCzwTy3f8xXSeFoi4z/zq4gWHqjPTP8g2Ppxcl EnY9kRDe87tNtzHRofdc2cywtE9K5uM2dJtH5CD053OvRVSqElyWp6RVNJnkrzUbL20A qaoYCqKQfH5kXED6WzHKNb2xfvVI56Ks8nCwoG8wzfID7JwI0bmjyRb7t5Em5/EHDVwt j55RTELE74mp4H5U0zhQ4nazHCmX24nVE2SmqBWfOx0NyQv8vRkbuifE0LtE5PyEbarU NK2w== X-Gm-Message-State: ALoCoQnCz0n2OB3sN6ek6acy8t5/71LZ08NeFirPRl/cp+hvLYTPlqa8dUs5tywED6+gF48hu0wt X-Received: by 10.69.19.139 with SMTP id gu11mr554023pbd.36.1402265460635; Sun, 08 Jun 2014 15:11:00 -0700 (PDT) Received: from [192.168.2.40] (ip98-177-234-123.ph.ph.cox.net. [98.177.234.123]) by mx.google.com with ESMTPSA id fk4sm2067567pab.23.2014.06.08.15.10.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 08 Jun 2014 15:11:00 -0700 (PDT) From: Ralph Goers X-Google-Original-From: Ralph Goers Content-Type: multipart/alternative; boundary="Apple-Mail=_D393FFF2-B548-4F81-9310-0F32106847EB" Message-Id: Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: Working on support for the properties file format. Date: Sun, 8 Jun 2014 15:10:58 -0700 References: To: Log4J Developers List In-Reply-To: X-Mailer: Apple Mail (2.1878.2) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail=_D393FFF2-B548-4F81-9310-0F32106847EB Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii One thing you could do is remove the type attribute by doing: log4j2.appenders.STDOUT=3DConsole Ralph On Jun 8, 2014, at 1:57 PM, Matt Sicker wrote: > https://paste.apache.org/e4m6 >=20 > Damn quick fingers. >=20 >=20 > On 8 June 2014 15:57, Matt Sicker wrote: > Actually, what I'm trying to do first is convert the log4j-test1 file = into a properties file before going anywhere with this. Basically, it'll = have to be more like the XML strict format. Here's how I've converted it = (as you can see, this file format sucks): >=20 >=20 >=20 > On 8 June 2014 15:20, Matt Sicker wrote: > So far it's awkward, but so was the original format. >=20 >=20 > On 8 June 2014 15:07, Paul Benedict wrote: > Ooops. Yes, XSL. The use of the XSL is to show that it's really = possible to convert an XML file into a flat file that's useable.=20 >=20 >=20 > Cheers, > Paul >=20 >=20 > On Sun, Jun 8, 2014 at 2:40 PM, Matt Sicker wrote: > Of course XML is the better format. Like I said, I don't even use the = properties file format. However, plenty of people still do, so it seems = beneficial to allow it in some form. >=20 > Do you mean an XSL file? >=20 >=20 > On 8 June 2014 14:21, Paul Benedict wrote: > I still think XML is a better format. But if you do allow property = files, consider first an XSD file that converts XML to properties. = Because if you can accomplish that, you will have proven to yourself = that the property file can represent everything an XML file can. >=20 > On Jun 8, 2014 2:00 PM, "Matt Sicker" wrote: > I'm only working on this because it sounds interesting and has been = requested by several people. I personally never use this file format in = Log4j 1, so I'm not entirely sure on how to best maintain compatibility = or similarity to the old format. >=20 > The technical side of parsing a flat properties map into a tree of = Nodes isn't that difficult. I'm sure we all took data structures at some = point in our lives ;) >=20 > Due to the limitations of properties files, the format has to be = slightly different than the usual hierarchy used in all the other = formats. The key difference I'd say is that instead of the "name" = attribute used on all the appenders and loggers, the name would be the = child "node" of the appenders element. For instance: >=20 > appenders.Name.attribute =3D ... > appenders.Name.anotherAttribute =3D ... >=20 > Of course, the keys would be converted to lower case for case = insensitivity (which makes me think we could really use a = CaseInsensitiveHashMap or something). >=20 > The old format uses something more like: >=20 > log4j.appender.Name.attribute =3D ... >=20 > For consistency, I think this should be appenders, and we could use = "log4j2" as the prefix (or even "configuration" for ultimate = consistency). Thoughts? >=20 > --=20 > Matt Sicker >=20 >=20 >=20 > --=20 > Matt Sicker >=20 >=20 >=20 >=20 > --=20 > Matt Sicker >=20 >=20 >=20 > --=20 > Matt Sicker >=20 >=20 >=20 > --=20 > Matt Sicker --Apple-Mail=_D393FFF2-B548-4F81-9310-0F32106847EB Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii One = thing you could do is remove the type attribute by doing:
log4j2.appenders.STDOUT=3DConsole
Ralph

On Jun = 8, 2014, at 1:57 PM, Matt Sicker <boards@gmail.com> = wrote:



On 8 June 2014 = 15:57, Matt Sicker <boards@gmail.com> wrote:
Actually, what I'm trying to do first is convert the = log4j-test1 file into a properties file before going anywhere with this. = Basically, it'll have to be more like the XML strict format. Here's how = I've converted it (as you can see, this file format sucks):



On 8 June 2014 15:20, = Matt Sicker <boards@gmail.com> wrote:
So far it's awkward, but so was the original = format.


On 8 June 2014 15:07, Paul Benedict <pbenedict@apache.org> wrote:
Ooops. = Yes, XSL. The use of the XSL is to show that it's really possible to = convert an XML file into a flat file that's useable.


Cheers,
Paul


On Sun, Jun 8, 2014 at 2:40 PM, Matt = Sicker <boards@gmail.com> wrote:
Of course XML is the better format. Like I said, I = don't even use the properties file format. However, plenty of people = still do, so it seems beneficial to allow it in some = form.

Do you mean an XSL file?


On 8 June 2014 14:21, Paul Benedict <pbenedict@apache.org> wrote:

I still = think XML is a better format. But if you do allow property files, = consider first an XSD file that converts XML to properties. Because if = you can accomplish that, you will have proven to yourself that the = property file can represent everything an XML file can.

On Jun 8, 2014 2:00 PM, "Matt Sicker" <boards@gmail.com> wrote:
I'm only working on this because it sounds interesting = and has been requested by several people. I personally never use this = file format in Log4j 1, so I'm not entirely sure on how to best maintain = compatibility or similarity to the old format.

The technical side of parsing a flat properties map into = a tree of Nodes isn't that difficult. I'm sure we all took data = structures at some point in our lives ;)

Due to = the limitations of properties files, the format has to be slightly = different than the usual hierarchy used in all the other formats. The = key difference I'd say is that instead of the "name" attribute used on = all the appenders and loggers, the name would be the child "node" of the = appenders element. For instance:

appenders.Name.attribute =3D = ...
appenders.Name.anotherAttribute =3D = ...

Of course, the keys would be converted to = lower case for case insensitivity (which makes me think we could really = use a CaseInsensitiveHashMap or something).

The old format uses something more = like:

log4j.appender.Name.attribute =3D = ...

For consistency, I think this should be = appenders, and we could use "log4j2" as the prefix (or even = "configuration" for ultimate consistency). Thoughts?

--
Matt Sicker <boards@gmail.com>



-- =
Matt Sicker <boards@gmail.com>




--
Matt Sicker <boards@gmail.com>



--
Matt Sicker <boards@gmail.com>



--
Matt = Sicker <boards@gmail.com>

= --Apple-Mail=_D393FFF2-B548-4F81-9310-0F32106847EB--