X-CGP-ClamAV-Result: CLEAN X-VirusScanner: Niversoft's CGPClamav Helper v1.22.2a (ClamAV engine v0.102.2) X-Junk-Score: 0 [] X-KAS-Score: 0 [] From: "Paul Hoadley" Received: from out5-smtp.messagingengine.com ([66.111.4.29] verified) by post.selbstdenker.com (CommuniGate Pro SMTP 6.3.3) with ESMTPS id 25588877 for webobjects-dev@wocommunity.org; Thu, 18 Mar 2021 03:02:24 +0100 Received-SPF: none receiver=post.selbstdenker.com; client-ip=66.111.4.29; envelope-from=paulh@logicsquad.net Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 476055C00AF for ; Wed, 17 Mar 2021 22:02:03 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 17 Mar 2021 22:02:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=aqbsFn 50AxK8FoM3LatkZfLyPxCxZlG7HNbFtyLYURQ=; b=JD57N/TDLsAfavPkh016LJ An7bZCwbyUsTnTS+iBeglQ0ZhBHQ8D2cGASfvscR3uUaDxUp+IGqlDDrz2fDk33Q NFqE447zNk0FijWTMzlAuSWJj893ZLXBum/Jq/Hrmr6bLFXMOOeQ3+irbF3fw7uQ wMTe7upgavkvj1ezuax5wLq+9ZDri4g5GAIX89ryj/O0QPOy3DUR8xbIaATruRGA Vw8NziIw/4yVs/XQOfC6ISjudEe0Tp1OWalvgtZUT4UoiYU/zPptV0woHzEdy5d6 pCw6cZsdwUUpYbK1PNkaK1BtGwLOMx2KIRKA0QcxVfdHwtbwWUiBgI94zGng9LbQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefhedggedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephfgtggfuffhfvfgjkffosegrtdhmrehhtdejnecuhfhrohhmpefrrghulhcu jfhorggulhgvhicuoehprghulhhhsehlohhgihgtshhquhgrugdrnhgvtheqnecuggftrf grthhtvghrnhepvefffedtfedttdeljeefveeuvedulefhhfegleetudfggfeugeekgeei veekieeknecuffhomhgrihhnpehlohhgghgvrhdrvghrpdgvrhdrnhgrmhgvpdgvrhgusg drnhgrmhgvpdhlohhgghhinhhgrdhishdplhhoghhitghsqhhurggurdhnvghtpdhlihhn khgvughinhdrtghomhenucfkphepvddtfedrvddujedruddtrddvgeelnecuvehluhhsth gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphgruhhlhheslhhoghhi tghsqhhurggurdhnvght X-ME-Proxy: Received: from [192.168.10.100] (203-217-10-249.perm.iinet.net.au [203.217.10.249]) by mail.messagingengine.com (Postfix) with ESMTPA id EDC281080067 for ; Wed, 17 Mar 2021 22:02:00 -0400 (EDT) Content-Type: multipart/alternative; boundary="Apple-Mail=_65C6E892-1D01-4F59-86AD-E337B5FAF059" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\)) Subject: Re: [WO-DEV] Log4J 2.x Date: Thu, 18 Mar 2021 12:31:55 +1030 References: To: WebObjects & WOnder Development In-Reply-To: Message-Id: <24F33527-1DB3-458F-9974-2DF366B85997@logicsquad.net> X-Mailer: Apple Mail (2.3445.104.17) --Apple-Mail=_65C6E892-1D01-4F59-86AD-E337B5FAF059 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 On 15 Mar 2021, at 15:45, Paul Hoadley = wrote: > 1. Is anyone using Log4J 2.x in a Wonder project? Is there a pain free = way to migrate from 1.x =E2=86=92 2.x while retaining the convenience of = Wonder's hierarchical Properties file loading? The answer here is "yes", though it probably depends on your definition = of "pain free". 1. Leaving aside the difference in syntax, it's easy enough to add = log4j-slf4j-impl to your dependencies, add log4j2.properties to = src/main/resources, and you're rolling with Log4J2. It's "retaining the = convenience of Wonder's hierarchical Properties file loading" that adds = the need for some additional gymnastics, but you can do it by creating a = custom ConfigurationFactory that pulls Log4J2 properties out of system = properties. You can use the Log4J2 mechanisms to indicate that your = custom factory should be used, but, of course, it then gets loaded well = before ERXProperties has done the hierarchical loading and merging with = system properties. However, you can set some sensible defaults in the = factory, and then re-run configuration in, say, your Application = constructor. 2. You'll lose ERXPatternLayout, and along with it specifiers like '$' = and '#' for application name and port, so adjust your patterns = accordingly. 3. The convenience of setting log levels like this: log4j.logger.er=3DINFO log4j.logger.er.extensions.ERXDatabaseContextDelegate=3DWARN is replaced by this: app.logging.loggers=3Der,erdb app.logging.logger.er.name=3Der app.logging.logger.er.level=3DINFO app.logging.logger.erdb.name=3Der.extensions.ERXDatabaseContextDelegate app.logging.logger.erdb.level=3DWARN So that's great. ("app.logging." is a custom prefix there, meaningful = only to my custom ConfigurationFactory.) A project for a rainy day might = be converting the former to the latter in the custom = ConfigurationFactory. If anyone wants more detail here, let me know. --=20 Paul Hoadley https://logicsquad.net/ https://www.linkedin.com/company/logic-squad/ --Apple-Mail=_65C6E892-1D01-4F59-86AD-E337B5FAF059 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 On = 15 Mar 2021, at 15:45, Paul Hoadley <webobjects-dev@wocommunity.org> wrote:

1. Is anyone using Log4J 2.x in a Wonder = project? Is there a pain free way to migrate from 1.x =E2=86=92 2.x = while retaining the convenience of Wonder's = hierarchical Properties file loading?

The answer here is "yes", though = it probably depends on your definition of "pain free".

1. Leaving aside the = difference in syntax, it's easy enough to add log4j-slf4j-impl to = your dependencies, add log4j2.properties to src/main/resources, and = you're rolling with Log4J2. It's "retaining the convenience of = Wonder's hierarchical Properties file loading" that adds the = need for some additional gymnastics, but you can do it by creating a = custom ConfigurationFactory that pulls Log4J2 properties out of = system properties. You can use the Log4J2 mechanisms to indicate that = your custom factory should be used, but, of course, it then gets loaded = well before ERXProperties has done the hierarchical loading and merging = with system properties. However, you can set some sensible defaults in = the factory, and then re-run configuration in, say, your Application = constructor.

2. = You'll lose ERXPatternLayout, and along with it specifiers like '$' = and '#' for application name and port, so adjust your patterns = accordingly.

3. = The convenience of setting log levels like this:

log4j.logger.er=3DINFO
log4j.logger.er.extensions.ERXDatabaseContextDelegate=3DWARN

is = replaced by this:

app.logging.loggers=3Der,erdb
app.logging.logger.er.name=3Der
app.logging.logger.er.level=3DINFO
app.logging.logger.erdb.name=3Der.extensions.ERXDatabaseContext= Delegate
app.logging.logger.erdb.level=3DWARN

So that's great. = ("app.logging." is a custom prefix there, meaningful only to my custom = ConfigurationFactory.) A project for a rainy day might be converting the = former to the latter in the custom ConfigurationFactory.

If anyone wants more = detail here, let me know.


-- 
Paul Hoadley
https://logicsquad.net/https://www.linkedin.com/company/logic-squad/

= --Apple-Mail=_65C6E892-1D01-4F59-86AD-E337B5FAF059--