[Bug 60297] Tomcat.setConnector not using supplied connector

2016-10-25 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=60297

--- Comment #3 from Remy Maucherat  ---
That already works, except there's no AprLifecycleListener. It's the same as
the regular configuration, which has it in server.xml. Remove it and there
won't be an APR connector used automatically.

-- 
You are receiving this mail because:
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1766514 - in /tomcat/trunk: java/org/apache/catalina/startup/Tomcat.java webapps/docs/changelog.xml

2016-10-25 Thread remm
Author: remm
Date: Tue Oct 25 11:34:16 2016
New Revision: 1766514

URL: http://svn.apache.org/viewvc?rev=1766514&view=rev
Log:
60297: Improve connector handling in embedded mode.

Modified:
tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java
tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java?rev=1766514&r1=1766513&r2=1766514&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java Tue Oct 25 
11:34:16 2016
@@ -138,7 +138,6 @@ public class Tomcat {
 protected Server server;
 protected Service service;
 protected Engine engine;
-protected Connector connector; // for more - customize the classes
 
 // To make it a bit easier to config for the common case
 // ( one host, one context ).
@@ -417,23 +416,32 @@ public class Tomcat {
  * @return A connector object that can be customized
  */
 public Connector getConnector() {
-getServer();
-if (connector != null) {
-return connector;
+Service service = getService();
+if (service.findConnectors().length > 0) {
+return service.findConnectors()[0];
 }
 
 // The same as in standard Tomcat configuration.
 // This creates an APR HTTP connector if AprLifecycleListener has been
 // configured (created) and Tomcat Native library is available.
 // Otherwise it creates a NIO HTTP connector.
-connector = new Connector("HTTP/1.1");
+Connector connector = new Connector("HTTP/1.1");
 connector.setPort(port);
-service.addConnector( connector );
+service.addConnector(connector);
 return connector;
 }
 
 public void setConnector(Connector connector) {
-this.connector = connector;
+Service service = getService();
+boolean found = false;
+for (Connector serviceConnector : service.findConnectors()) {
+if (connector == serviceConnector) {
+found = true;
+}
+}
+if (!found) {
+service.addConnector(connector);
+}
 }
 
 /**

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1766514&r1=1766513&r2=1766514&view=diff
==
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Tue Oct 25 11:34:16 2016
@@ -80,6 +80,9 @@
 Correctly test for control characters when reading the provided 
shutdown
 password. (markt)
   
+  
+60297: Simplify connector creation in embedded mode. (remm)
+  
 
   
   



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 60297] Tomcat.setConnector not using supplied connector

2016-10-25 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=60297

--- Comment #4 from Axel U  ---
Ok.

-- 
You are receiving this mail because:
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1766521 - in /tomcat/tc8.5.x/trunk: ./ java/org/apache/catalina/startup/Tomcat.java webapps/docs/changelog.xml

2016-10-25 Thread remm
Author: remm
Date: Tue Oct 25 11:52:00 2016
New Revision: 1766521

URL: http://svn.apache.org/viewvc?rev=1766521&view=rev
Log:
60297: Improve connector handling in embedded mode.

Modified:
tomcat/tc8.5.x/trunk/   (props changed)
tomcat/tc8.5.x/trunk/java/org/apache/catalina/startup/Tomcat.java
tomcat/tc8.5.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc8.5.x/trunk/
--
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Oct 25 11:52:00 2016
@@ -1 +1 @@
-/tomcat/trunk:1734785,1734799,1734845,1734928,1735041,1735044,1735480,1735577,1735597,1735599-1735600,1735615,1736145,1736162,1736209,1736280,1736297,1736299,1736489,1736646,1736703,1736836,1736849,1737104-1737105,1737112,1737117,1737119-1737120,1737155,1737157,1737192,1737280,1737339,1737632,1737664,1737715,1737748,1737785,1737834,1737860,1737903,1737959,1738005,1738007,1738014-1738015,1738018,1738022,1738039,1738043,1738059-1738060,1738147,1738149,1738174-1738175,1738261,1738589,1738623-1738625,1738643,1738816,1738850,1738855,1738946-1738948,1738953-1738954,1738979,1738982,1739079-1739081,1739087,1739113,1739153,1739172,1739176,1739191,1739474,1739726,1739762,1739775,1739814,1739817-1739818,1739975,1740131,1740324,1740465,1740495,1740508-1740509,1740520,1740535,1740707,1740803,1740810,1740969,1740980,1740991,1740997,1741015,1741033,1741036,1741058,1741060,1741080,1741147,1741159,1741164,1741173,1741181,1741190,1741197,1741202,1741208,1741213,1741221,1741225,1741232,1741409,1741501
 
,1741677,1741892,1741896,1741984,1742023,1742042,1742071,1742090,1742093,1742101,1742105,1742111,1742139,1742146,1742148,1742166,1742181,1742184,1742187,1742246,1742248-1742251,1742263-1742264,1742268,1742276,1742369,1742387,1742448,1742509-1742512,1742917,1742919,1742933,1742975-1742976,1742984,1742986,1743019,1743115,1743117,1743124-1743125,1743134,1743425,1743554,1743679,1743696-1743698,1743700-1743701,1744058,1744064-1744065,1744125,1744194,1744229,1744270,1744323,1744432,1744684,1744697,1744705,1744713,1744760,1744786,1745083,1745142-1745143,1745145,1745177,1745179-1745180,1745227,1745248,1745254,1745337,1745467,1745473,1745576,1745735,1745744,1746304,1746306-1746307,1746319,1746327,1746338,1746340-1746341,1746344,1746427,1746441,1746473,1746490,1746492,1746495-1746496,1746499-1746501,1746503-1746507,1746509,1746549,1746551,1746554,1746556,1746558,1746584,1746620,1746649,1746724,1746939,1746989,1747014,1747028,1747035,1747210,1747225,1747234,1747253,1747404,1747506,1747536,1747
 
924,1747980,1747993,1748001,1748253,1748452,1748547,1748629,1748676,1748715,1749287,1749296,1749328,1749373,1749465,1749506,1749508,1749665-1749666,1749763,1749865-1749866,1749898,1749978,1749980,1750011,1750015,1750056,1750480,1750617,1750634,1750692,1750697,1750700,1750703,1750707,1750714,1750718,1750723,1750774,1750899,1750975,1750995,1751061,1751097,1751173,1751438,1751447,1751463,1751702,1752212,1752737,1752745,1753078,1753080,1753358,1753363,1754111,1754140-1754141,1754281,1754310,1754445,1754467,1754494,1754496,1754528,1754532-1754533,1754613,1754714,1754874,1754941,1754944,1754950-1754951,1755005,1755007,1755009,1755132,1755180-1755181,1755185,1755190,1755204-1755206,1755208,1755214,1755224,1755227,1755230,1755629,1755646-1755647,1755650,1755653,1755675,1755680,1755683,1755693,1755717,1755731-1755737,1755812,1755828,1755884,1755890,1755918-1755919,1755942,1755958,1755960,1755970,1755993,1756013,1756019,1756039,1756056,1756083-1756114,1756175,1756288-1756289,1756408-1756410,1
 
756778,1756798,1756878,1756898,1756939,1757123-1757124,1757126,1757128,1757132-1757133,1757136,1757145,1757167-1757168,1757175,1757180,1757182,1757195,1757271,1757278,1757347,1757353-1757354,1757363,1757374,1757399,1757406,1757408,1757485,1757495,1757499,1757527,1757578,1757684,1757722,1757727,1757853,1757903,1757997,1758072-1758075,1758078-1758079,1758292,1758369,1758423,1758425-1758427,1758430,1758459,1758483,1758486-1758487,1758499,1758525,1758556,1758582,1758584,1758588,1758842,1759019,1759212,1759224,1759227,1759252,1759274,1759513-1759516,1759611,1760005,1760022,1760300,1760397,1760446,1760454,1760640,1760648,1761057,1761422,1761491,1761498,1761500-1761501,1761550,1761553,1761572,1761574,1761625-1761626,1761628,1761682,1761740,1761752,1762123,1762168,1762172,1762182,1762202,1762288,1762296,1762348,1762353,1762374,1762503,1762505,1762541,1762608,1762710,1762753,1762766,1762769,1762944,1762947,1762953,1763167,1763179,1763232,1763259,1763271-1763272,1763276-1763277,1763319-176332
 
0,1763370,1763372,1763375,1763377,1763393,1763412,1763430,1763450,1763512,1763516,1763518,1763520,1763529,1763574,1763634-1763635,1763718,1763786,1763798-1763799,1764083,1764425,1764646,1764648-1764649,1764659,1764663,1764682,1764862,1764866-1764867,1764870,1764897,1765133,1765299,1765358,1765439,1765447,1765495,1765502,1765569-1765571,1765579,1765582,1765589-1765590,1765794,1765801,1765813,1765815,1766276
+/tomcat/trunk:1734785,1734799,173

[Bug 60297] Tomcat.setConnector not using supplied connector

2016-10-25 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=60297

Remy Maucherat  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from Remy Maucherat  ---
The fix will be in 9.0.0.M12 and 8.5.7. Should it be ported to 8.0.x and 7.0.x
? I'm hesitating since it's a behavior change.

-- 
You are receiving this mail because:
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[GUMP@vmgump]: Project tomcat-tc7.0.x-test-apr (in module tomcat-7.0.x) failed

2016-10-25 Thread Bill Barker
To whom it may engage...

This is an automated request, but not an unsolicited one. For 
more information please visit http://gump.apache.org/nagged.html, 
and/or contact the folk at gene...@gump.apache.org.

Project tomcat-tc7.0.x-test-apr has an issue affecting its community 
integration.
This issue affects 1 projects.
The current state of this project is 'Failed', with reason 'Build Failed'.
For reference only, the following projects are affected by this:
- tomcat-tc7.0.x-test-apr :  Tomcat 7.x, a web server implementing Java 
Servlet 3.0,
...


Full details are available at:

http://vmgump.apache.org/gump/public/tomcat-7.0.x/tomcat-tc7.0.x-test-apr/index.html

That said, some information snippets are provided here.

The following annotations (debug/informational/warning/error messages) were 
provided:
 -DEBUG- Dependency on tomcat-tc7.0.x-dbcp exists, no need to add for property 
tomcat-dbcp-src.jar.
 -DEBUG- Dependency on commons-daemon exists, no need to add for property 
commons-daemon.native.src.tgz.
 -DEBUG- Dependency on commons-daemon exists, no need to add for property 
tomcat-native.tar.gz.
 -DEBUG- Dependency on tomcat-tc7.0.x-dbcp exists, no need to add for property 
tomcat-dbcp.home.
 -INFO- Failed with reason build failed
 -INFO- Project Reports in: 
/srv/gump/public/workspace/tomcat-7.0.x/output/logs-APR
 -INFO- Project Reports in: 
/srv/gump/public/workspace/tomcat-7.0.x/output/test-tmp-APR/logs



The following work was performed:
http://vmgump.apache.org/gump/public/tomcat-7.0.x/tomcat-tc7.0.x-test-apr/gump_work/build_tomcat-7.0.x_tomcat-tc7.0.x-test-apr.html
Work Name: build_tomcat-7.0.x_tomcat-tc7.0.x-test-apr (Type: Build)
Work ended in a state of : Failed
Elapsed: 26 mins 55 secs
Command Line: /usr/lib/jvm/java-8-oracle/bin/java -Djava.awt.headless=true 
-Dbuild.sysclasspath=only org.apache.tools.ant.Main 
-Dgump.merge=/srv/gump/public/gump/work/merge.xml 
-Dbase.path=/srv/gump/public/workspace/tomcat-7.0.x/tomcat-build-libs 
-Dcommons-pool.home=/srv/gump/public/workspace/commons-pool-1.x 
-Dtest.temp=output/test-tmp-APR 
-Djunit.jar=/srv/gump/public/workspace/junit/target/junit-4.13-SNAPSHOT.jar 
-Dobjenesis.jar=/srv/gump/public/workspace/objenesis/main/target/objenesis-2.5-SNAPSHOT.jar
 -Dexamples.sources.skip=true 
-Dcommons-daemon.jar=/srv/gump/public/workspace/apache-commons/daemon/dist/commons-daemon-20161025.jar
 
-Dtomcat-dbcp-src.jar=/srv/gump/public/workspace/tomcat-7.0.x/tomcat-deps/tomcat-dbcp-src.jar
 -Dtomcat-dbcp.home=/srv/gump/public/workspace/tomcat-7.0.x/tomcat-deps 
-Dtest.excludePerformance=true 
-Dhamcrest.jar=/srv/gump/packages/hamcrest/hamcrest-core-1.3.jar 
-Dcommons-dbcp.home=/srv/gump/public/workspace/commons-dbcp-1.x 
-Dexecute.test.apr=true -Dexec
 ute.test.bio=false 
-Dcommons-daemon.native.src.tgz=/srv/gump/public/workspace/apache-commons/daemon/dist/bin/commons-daemon-20161025-native-src.tar.gz
 -Dtest.reports=output/logs-APR 
-Dtomcat-native.tar.gz=/srv/gump/public/workspace/apache-commons/daemon/dist/bin/commons-daemon-20161025-native-src.tar.gz
 -Djdt.jar=/srv/gump/packages/eclipse/plugins/R-4.5-201506032000/ecj-4.5.jar 
-Dtest.apr.loc=/srv/gump/public/workspace/tomcat-native-12/dest-20161025/lib 
-Dtest.relaxTiming=true -Dexecute.test.nio=false -Dtest.accesslog=true 
-Dtomcat-dbcp.jar=/srv/gump/public/workspace/tomcat-7.0.x/tomcat-deps/tomcat-dbcp-20161025.jar
 
-Deasymock.jar=/srv/gump/public/workspace/easymock/core/target/easymock-3.5-SNAPSHOT.jar
 -Dcglib.jar=/srv/gump/packages/cglib/cglib-nodep-2.2.jar test 
[Working Directory: /srv/gump/public/workspace/tomcat-7.0.x]
CLASSPATH: 
/usr/lib/jvm/java-8-oracle/lib/tools.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/webapps/examples/WEB-INF/classes:/srv/gump/public/workspace/tomcat-7.0.x/output/testclasses:/srv/gump/public/workspace/ant/dist/lib/ant.jar:/srv/gump/public/workspace/ant/dist/lib/ant-launcher.jar:/srv/gump/public/workspace/ant/dist/lib/ant-jmf.jar:/srv/gump/public/workspace/ant/dist/lib/ant-junit.jar:/srv/gump/public/workspace/ant/dist/lib/ant-junit4.jar:/srv/gump/public/workspace/ant/dist/lib/ant-swing.jar:/srv/gump/public/workspace/ant/dist/lib/ant-apache-resolver.jar:/srv/gump/public/workspace/ant/dist/lib/ant-apache-xalan2.jar:/srv/gump/public/workspace/xml-commons/java/build/resolver.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/bin/bootstrap.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/bin/tomcat-juli.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/annotations-api.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/servlet-api.ja
 
r:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/jsp-api.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/el-api.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/catalina.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/catalina-ant.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/tomcat-coyote.

TC 8.5 and Log4J2 via Juli: Wrong location info

2016-10-25 Thread Rainer Jung

Hi everyone,

when using TC 8.5 with the Log4J2 jul bridge the location info in the 
Log4J output points to the juli class DirectJDKLog instead of the Tomcat 
class with the juli log call. Only the category/logger name is correct:


%c: org.apache.catalina.core.StandardServer (Example, correct)
%C: org.apache.juli.logging.DirectJDKLog
%l: org.apache.juli.logging.DirectJDKLog.log(DirectJDKLog.java:179)
%M: log
%F: DirectJDKLog.java
%L: 179

The jul bridge does not try to fully populate al possible location info, 
but instead only the category name. Log4J then later gets the log 
location from the stack frame that calls the jul bridge which always 
gives org.apache.juli.logging.DirectJDKLog.


It seems we either need to directly call the jul bridge without an 
intermediate logging impl class, or the Log4J2 jul bridge must be made 
more complex.


Any opinion? Ideas?

I know that the location info is expensive to get, but failing to 
support the correct location info is IMHO bad. The old adapter solution 
supported correct location info in log4j.


Regards,

Rainer

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: TC 8.5 and Log4J2 via Juli: Wrong location info

2016-10-25 Thread Mark Thomas
On 25/10/2016 14:17, Rainer Jung wrote:
> Hi everyone,
> 
> when using TC 8.5 with the Log4J2 jul bridge the location info in the
> Log4J output points to the juli class DirectJDKLog instead of the Tomcat
> class with the juli log call. Only the category/logger name is correct:
> 
> %c: org.apache.catalina.core.StandardServer (Example, correct)
> %C: org.apache.juli.logging.DirectJDKLog
> %l: org.apache.juli.logging.DirectJDKLog.log(DirectJDKLog.java:179)
> %M: log
> %F: DirectJDKLog.java
> %L: 179
> 
> The jul bridge does not try to fully populate al possible location info,
> but instead only the category name. Log4J then later gets the log
> location from the stack frame that calls the jul bridge which always
> gives org.apache.juli.logging.DirectJDKLog.
> 
> It seems we either need to directly call the jul bridge without an
> intermediate logging impl class, or the Log4J2 jul bridge must be made
> more complex.
> 
> Any opinion? Ideas?

I did look at whether or not we could remove the use of DirectJDKLog -
essentially reducing JULI to the custom LogManager. My conclusion at the
time was it was possible but was a whole lot of effort for very little
benefit. Maybe this tips the balance?

The other option would be to provide a dedicated log4j2 adadptor - maybe
along with appropriate adapters for other logging frameworks as well.

> I know that the location info is expensive to get, but failing to
> support the correct location info is IMHO bad. The old adapter solution
> supported correct location info in log4j.

I think we have two options:

1. Code to just java.util.logging as sufficient and let the logging
frameworks deal with hooking in to java.util.logging. This is
essentially the option that removes code.

2. Provide an adaptor for at least log4j2 and possible other frameworks.
This is essentially the option that adds code.

Option 1 means less code but less flexibility. Option 2 is more code but
what we get in return is more flexibility maybe implementation options
for better performance.

Another advantage of 1 is that it removes JULI as a dependency from much
of out code. This could make it simpler for others to re-use.

Personally, I lean towards 1. but I'm not going to object if someone
wants to pursue 2.

Mark

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: TC 8.5 and Log4J2 via Juli: Wrong location info

2016-10-25 Thread Romain Manni-Bucau
Hi guys,

since now tomcat has Log API as a SPI doing 2 is easy (
http://svn.apache.org/repos/asf/openwebbeans/microwave/trunk/microwave-core/src/main/java/org/apache/microwave/logging/tomcat/Log4j2Log.java)
and
just a drop-in jar setup so not sure it needs to be in tomcat default
delivery.


Romain Manni-Bucau
@rmannibucau  |  Blog
 | Old Wordpress Blog
 | Github  |
LinkedIn  | Tomitriber
 | JavaEE Factory


2016-10-25 15:28 GMT+02:00 Mark Thomas :

> On 25/10/2016 14:17, Rainer Jung wrote:
> > Hi everyone,
> >
> > when using TC 8.5 with the Log4J2 jul bridge the location info in the
> > Log4J output points to the juli class DirectJDKLog instead of the Tomcat
> > class with the juli log call. Only the category/logger name is correct:
> >
> > %c: org.apache.catalina.core.StandardServer (Example, correct)
> > %C: org.apache.juli.logging.DirectJDKLog
> > %l: org.apache.juli.logging.DirectJDKLog.log(DirectJDKLog.java:179)
> > %M: log
> > %F: DirectJDKLog.java
> > %L: 179
> >
> > The jul bridge does not try to fully populate al possible location info,
> > but instead only the category name. Log4J then later gets the log
> > location from the stack frame that calls the jul bridge which always
> > gives org.apache.juli.logging.DirectJDKLog.
> >
> > It seems we either need to directly call the jul bridge without an
> > intermediate logging impl class, or the Log4J2 jul bridge must be made
> > more complex.
> >
> > Any opinion? Ideas?
>
> I did look at whether or not we could remove the use of DirectJDKLog -
> essentially reducing JULI to the custom LogManager. My conclusion at the
> time was it was possible but was a whole lot of effort for very little
> benefit. Maybe this tips the balance?
>
> The other option would be to provide a dedicated log4j2 adadptor - maybe
> along with appropriate adapters for other logging frameworks as well.
>
> > I know that the location info is expensive to get, but failing to
> > support the correct location info is IMHO bad. The old adapter solution
> > supported correct location info in log4j.
>
> I think we have two options:
>
> 1. Code to just java.util.logging as sufficient and let the logging
> frameworks deal with hooking in to java.util.logging. This is
> essentially the option that removes code.
>
> 2. Provide an adaptor for at least log4j2 and possible other frameworks.
> This is essentially the option that adds code.
>
> Option 1 means less code but less flexibility. Option 2 is more code but
> what we get in return is more flexibility maybe implementation options
> for better performance.
>
> Another advantage of 1 is that it removes JULI as a dependency from much
> of out code. This could make it simpler for others to re-use.
>
> Personally, I lean towards 1. but I'm not going to object if someone
> wants to pursue 2.
>
> Mark
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>
>


Re: TC 8.5 and Log4J2 via Juli: Wrong location info

2016-10-25 Thread Rémy Maucherat
2016-10-25 15:33 GMT+02:00 Romain Manni-Bucau :

> Hi guys,
>
> since now tomcat has Log API as a SPI doing 2 is easy (
> http://svn.apache.org/repos/asf/openwebbeans/microwave/
> trunk/microwave-core/src/main/java/org/apache/microwave/
> logging/tomcat/Log4j2Log.java)
> and
> just a drop-in jar setup so not sure it needs to be in tomcat default
> delivery.
>
> But if this is enough and done through reflection, it avoids the
dependency too.

1) isn't bad, the original idea was to use java.util.logging but add the
classloading log manager to be able to log per webapp.

Rémy


svn commit: r1766533 - in /tomcat/trunk: java/org/apache/coyote/ java/org/apache/coyote/http2/ test/org/apache/coyote/http2/ webapps/docs/ webapps/docs/config/

2016-10-25 Thread markt
Author: markt
Date: Tue Oct 25 13:54:09 2016
New Revision: 1766533

URL: http://svn.apache.org/viewvc?rev=1766533&view=rev
Log:
Add support for limiting trailer header count and size

Added:
tomcat/trunk/java/org/apache/coyote/CloseNowException.java   (with props)
Modified:
tomcat/trunk/java/org/apache/coyote/AbstractProcessor.java
tomcat/trunk/java/org/apache/coyote/http2/Constants.java
tomcat/trunk/java/org/apache/coyote/http2/Http2Protocol.java
tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java
tomcat/trunk/java/org/apache/coyote/http2/Stream.java
tomcat/trunk/test/org/apache/coyote/http2/TestHttp2Limits.java
tomcat/trunk/webapps/docs/changelog.xml
tomcat/trunk/webapps/docs/config/http2.xml

Modified: tomcat/trunk/java/org/apache/coyote/AbstractProcessor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/AbstractProcessor.java?rev=1766533&r1=1766532&r2=1766533&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/AbstractProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/AbstractProcessor.java Tue Oct 25 
13:54:09 2016
@@ -269,6 +269,8 @@ public abstract class AbstractProcessor
 action(ActionCode.COMMIT, null);
 try {
 finishResponse();
+} catch (CloseNowException cne) {
+setErrorState(ErrorState.CLOSE_NOW, cne);
 } catch (IOException e) {
 setErrorState(ErrorState.CLOSE_CONNECTION_NOW, e);
 }

Added: tomcat/trunk/java/org/apache/coyote/CloseNowException.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/CloseNowException.java?rev=1766533&view=auto
==
--- tomcat/trunk/java/org/apache/coyote/CloseNowException.java (added)
+++ tomcat/trunk/java/org/apache/coyote/CloseNowException.java Tue Oct 25 
13:54:09 2016
@@ -0,0 +1,51 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.coyote;
+
+import java.io.IOException;
+
+/**
+ * This exception is thrown to signal to the Tomcat internals that an error has
+ * occurred that requires the connection to be closed. For multiplexed 
protocols
+ * such as HTTP/2, this means the channel must be closed but the connection can
+ * continue. For non-multiplexed protocols, the connection must be closed. It
+ * corresponds to {@link ErrorState#CLOSE_NOW}.
+ */
+public class CloseNowException extends IOException {
+
+private static final long serialVersionUID = 1L;
+
+
+public CloseNowException() {
+super();
+}
+
+
+public CloseNowException(String message, Throwable cause) {
+super(message, cause);
+}
+
+
+public CloseNowException(String message) {
+super(message);
+}
+
+
+public CloseNowException(Throwable cause) {
+super(cause);
+}
+}

Propchange: tomcat/trunk/java/org/apache/coyote/CloseNowException.java
--
svn:eol-style = native

Modified: tomcat/trunk/java/org/apache/coyote/http2/Constants.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/Constants.java?rev=1766533&r1=1766532&r2=1766533&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http2/Constants.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http2/Constants.java Tue Oct 25 
13:54:09 2016
@@ -25,7 +25,9 @@ public class Constants {
 static final int DEFAULT_HEADER_READ_BUFFER_SIZE = 1024;
 
 // Limits
+static final int DEFAULT_MAX_COOKIE_COUNT = 200;
 static final int DEFAULT_MAX_HEADER_COUNT = 100;
 static final int DEFAULT_MAX_HEADER_SIZE = 8 * 1024;
-static final int DEFAULT_MAX_COOKIE_COUNT = 200;
+static final int DEFAULT_MAX_TRAILER_COUNT = 100;
+static final int DEFAULT_MAX_TRAILER_SIZE = 8 * 1024;
 }

Modified: tomcat/trunk/java/org/apache/coyote/http2/Http2Protocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/Http2Protocol.

Re: TC 8.5 and Log4J2 via Juli: Wrong location info

2016-10-25 Thread Rainer Jung

Am 25.10.2016 um 15:49 schrieb Rémy Maucherat:

2016-10-25 15:33 GMT+02:00 Romain Manni-Bucau :


Hi guys,

since now tomcat has Log API as a SPI doing 2 is easy (
http://svn.apache.org/repos/asf/openwebbeans/microwave/
trunk/microwave-core/src/main/java/org/apache/microwave/
logging/tomcat/Log4j2Log.java)
and
just a drop-in jar setup so not sure it needs to be in tomcat default
delivery.


I see. This sounds pretty simple.


But if this is enough and done through reflection, it avoids the
dependency too.


Just that I understand: you mean the dependency on the Log4J jul bridge? 
Or some other dependency?



1) isn't bad, the original idea was to use java.util.logging but add the
classloading log manager to be able to log per webapp.


Although I never used the juli-per-webapp feature, we probably don't 
want to loose it.


Regards,

Rainer


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1766535 - in /tomcat/trunk: java/org/apache/coyote/http2/ test/org/apache/coyote/http2/

2016-10-25 Thread markt
Author: markt
Date: Tue Oct 25 14:14:08 2016
New Revision: 1766535

URL: http://svn.apache.org/viewvc?rev=1766535&view=rev
Log:
Fail earlier if trailer headers don't end the stream

Modified:
tomcat/trunk/java/org/apache/coyote/http2/Http2Parser.java
tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java
tomcat/trunk/java/org/apache/coyote/http2/LocalStrings.properties
tomcat/trunk/java/org/apache/coyote/http2/Stream.java
tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.java

Modified: tomcat/trunk/java/org/apache/coyote/http2/Http2Parser.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/Http2Parser.java?rev=1766535&r1=1766534&r2=1766535&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http2/Http2Parser.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http2/Http2Parser.java Tue Oct 25 
14:14:08 2016
@@ -199,11 +199,13 @@ class Http2Parser {
 private void readHeadersFrame(int streamId, int flags, int payloadSize)
 throws Http2Exception, IOException {
 
+headersEndStream = Flags.isEndOfStream(flags);
+
 if (hpackDecoder == null) {
 hpackDecoder = output.getHpackDecoder();
 }
 try {
-hpackDecoder.setHeaderEmitter(output.headersStart(streamId));
+hpackDecoder.setHeaderEmitter(output.headersStart(streamId, 
headersEndStream));
 } catch (StreamException se) {
 swallow(streamId, payloadSize, false);
 throw se;
@@ -247,8 +249,6 @@ class Http2Parser {
 
 swallow(streamId, padLength, true);
 
-headersEndStream = Flags.isEndOfStream(flags);
-
 if (Flags.isEndOfHeaders(flags)) {
 onHeadersComplete(streamId);
 } else {
@@ -638,7 +638,7 @@ class Http2Parser {
 void swallowedPadding(int streamId, int paddingLength) throws 
ConnectionException, IOException;
 
 // Header frames
-HeaderEmitter headersStart(int streamId) throws Http2Exception;
+HeaderEmitter headersStart(int streamId, boolean headersEndStream) 
throws Http2Exception;
 void headersEnd(int streamId) throws ConnectionException;
 
 // Priority frames (also headers)

Modified: tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java?rev=1766535&r1=1766534&r2=1766535&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java Tue Oct 
25 14:14:08 2016
@@ -1271,14 +1271,14 @@ class Http2UpgradeHandler extends Abstra
 
 
 @Override
-public HeaderEmitter headersStart(int streamId) throws Http2Exception {
+public HeaderEmitter headersStart(int streamId, boolean headersEndStream) 
throws Http2Exception {
 if (connectionState.get().isNewStreamAllowed()) {
 Stream stream = getStream(streamId, false);
 if (stream == null) {
 stream = createRemoteStream(streamId);
 }
 stream.checkState(FrameType.HEADERS);
-stream.receivedStartOfHeaders();
+stream.receivedStartOfHeaders(headersEndStream);
 closeIdleStreams(streamId);
 if (localSettings.getMaxConcurrentStreams() < 
activeRemoteStreamCount.incrementAndGet()) {
 activeRemoteStreamCount.decrementAndGet();

Modified: tomcat/trunk/java/org/apache/coyote/http2/LocalStrings.properties
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/LocalStrings.properties?rev=1766535&r1=1766534&r2=1766535&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http2/LocalStrings.properties (original)
+++ tomcat/trunk/java/org/apache/coyote/http2/LocalStrings.properties Tue Oct 
25 14:14:08 2016
@@ -77,6 +77,7 @@ stream.notWritable=Connection [{0}], Str
 stream.reprioritisation.debug=Connection [{0}], Stream [{1}], Exclusive [{2}], 
Parent [{3}], Weight [{4}]
 stream.reset.debug=Connection [{0}], Stream [{1}], Reset due to [{2}]
 stream.reset.fail=Connection [{0}], Stream [{1}], Failed to reset stream
+stream.trialerHeader.noEndOfStream=Connection [{0}], Stream [{1}], The trailer 
headers did not include the end of stream flag
 stream.write=Connection [{0}], Stream [{1}]
 
 stream.inputBuffer.copy=Copying [{0}] bytes from inBuffer to outBuffer

Modified: tomcat/trunk/java/org/apache/coyote/http2/Stream.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/Stream.java?rev=1766535&r1=1766534&r2=1766535&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/h

svn commit: r1766536 - in /tomcat/tc8.5.x/trunk: ./ java/org/apache/coyote/ java/org/apache/coyote/http2/ test/org/apache/coyote/http2/ webapps/docs/ webapps/docs/config/

2016-10-25 Thread markt
Author: markt
Date: Tue Oct 25 14:16:50 2016
New Revision: 1766536

URL: http://svn.apache.org/viewvc?rev=1766536&view=rev
Log:
Add support for limiting trailer header count and size

Added:
tomcat/tc8.5.x/trunk/java/org/apache/coyote/CloseNowException.java
  - copied unchanged from r1766533, 
tomcat/trunk/java/org/apache/coyote/CloseNowException.java
Modified:
tomcat/tc8.5.x/trunk/   (props changed)
tomcat/tc8.5.x/trunk/java/org/apache/coyote/AbstractProcessor.java
tomcat/tc8.5.x/trunk/java/org/apache/coyote/http2/Constants.java
tomcat/tc8.5.x/trunk/java/org/apache/coyote/http2/Http2Protocol.java
tomcat/tc8.5.x/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java
tomcat/tc8.5.x/trunk/java/org/apache/coyote/http2/Stream.java
tomcat/tc8.5.x/trunk/test/org/apache/coyote/http2/TestHttp2Limits.java
tomcat/tc8.5.x/trunk/webapps/docs/changelog.xml
tomcat/tc8.5.x/trunk/webapps/docs/config/http2.xml

Propchange: tomcat/tc8.5.x/trunk/
--
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Oct 25 14:16:50 2016
@@ -1 +1 @@
-/tomcat/trunk:1734785,1734799,1734845,1734928,1735041,1735044,1735480,1735577,1735597,1735599-1735600,1735615,1736145,1736162,1736209,1736280,1736297,1736299,1736489,1736646,1736703,1736836,1736849,1737104-1737105,1737112,1737117,1737119-1737120,1737155,1737157,1737192,1737280,1737339,1737632,1737664,1737715,1737748,1737785,1737834,1737860,1737903,1737959,1738005,1738007,1738014-1738015,1738018,1738022,1738039,1738043,1738059-1738060,1738147,1738149,1738174-1738175,1738261,1738589,1738623-1738625,1738643,1738816,1738850,1738855,1738946-1738948,1738953-1738954,1738979,1738982,1739079-1739081,1739087,1739113,1739153,1739172,1739176,1739191,1739474,1739726,1739762,1739775,1739814,1739817-1739818,1739975,1740131,1740324,1740465,1740495,1740508-1740509,1740520,1740535,1740707,1740803,1740810,1740969,1740980,1740991,1740997,1741015,1741033,1741036,1741058,1741060,1741080,1741147,1741159,1741164,1741173,1741181,1741190,1741197,1741202,1741208,1741213,1741221,1741225,1741232,1741409,1741501
 
,1741677,1741892,1741896,1741984,1742023,1742042,1742071,1742090,1742093,1742101,1742105,1742111,1742139,1742146,1742148,1742166,1742181,1742184,1742187,1742246,1742248-1742251,1742263-1742264,1742268,1742276,1742369,1742387,1742448,1742509-1742512,1742917,1742919,1742933,1742975-1742976,1742984,1742986,1743019,1743115,1743117,1743124-1743125,1743134,1743425,1743554,1743679,1743696-1743698,1743700-1743701,1744058,1744064-1744065,1744125,1744194,1744229,1744270,1744323,1744432,1744684,1744697,1744705,1744713,1744760,1744786,1745083,1745142-1745143,1745145,1745177,1745179-1745180,1745227,1745248,1745254,1745337,1745467,1745473,1745576,1745735,1745744,1746304,1746306-1746307,1746319,1746327,1746338,1746340-1746341,1746344,1746427,1746441,1746473,1746490,1746492,1746495-1746496,1746499-1746501,1746503-1746507,1746509,1746549,1746551,1746554,1746556,1746558,1746584,1746620,1746649,1746724,1746939,1746989,1747014,1747028,1747035,1747210,1747225,1747234,1747253,1747404,1747506,1747536,1747
 
924,1747980,1747993,1748001,1748253,1748452,1748547,1748629,1748676,1748715,1749287,1749296,1749328,1749373,1749465,1749506,1749508,1749665-1749666,1749763,1749865-1749866,1749898,1749978,1749980,1750011,1750015,1750056,1750480,1750617,1750634,1750692,1750697,1750700,1750703,1750707,1750714,1750718,1750723,1750774,1750899,1750975,1750995,1751061,1751097,1751173,1751438,1751447,1751463,1751702,1752212,1752737,1752745,1753078,1753080,1753358,1753363,1754111,1754140-1754141,1754281,1754310,1754445,1754467,1754494,1754496,1754528,1754532-1754533,1754613,1754714,1754874,1754941,1754944,1754950-1754951,1755005,1755007,1755009,1755132,1755180-1755181,1755185,1755190,1755204-1755206,1755208,1755214,1755224,1755227,1755230,1755629,1755646-1755647,1755650,1755653,1755675,1755680,1755683,1755693,1755717,1755731-1755737,1755812,1755828,1755884,1755890,1755918-1755919,1755942,1755958,1755960,1755970,1755993,1756013,1756019,1756039,1756056,1756083-1756114,1756175,1756288-1756289,1756408-1756410,1
 
756778,1756798,1756878,1756898,1756939,1757123-1757124,1757126,1757128,1757132-1757133,1757136,1757145,1757167-1757168,1757175,1757180,1757182,1757195,1757271,1757278,1757347,1757353-1757354,1757363,1757374,1757399,1757406,1757408,1757485,1757495,1757499,1757527,1757578,1757684,1757722,1757727,1757853,1757903,1757997,1758072-1758075,1758078-1758079,1758292,1758369,1758423,1758425-1758427,1758430,1758459,1758483,1758486-1758487,1758499,1758525,1758556,1758582,1758584,1758588,1758842,1759019,1759212,1759224,1759227,1759252,1759274,1759513-1759516,1759611,1760005,1760022,1760300,1760397,1760446,1760454,1760640,1760648,1761057,1761422,1761491,1761498,1761500-1761501,1761550,1761553,1761572,1761574,1761625-1761626,1761628,1761682,1761740,1761752,1762123,1762168,1762172,1762182,1762202,1762288,1762296,1762348,1762353,1762374,1762503,17625

svn commit: r1766538 - in /tomcat/tc8.5.x/trunk: ./ java/org/apache/coyote/http2/ test/org/apache/coyote/http2/

2016-10-25 Thread markt
Author: markt
Date: Tue Oct 25 14:17:49 2016
New Revision: 1766538

URL: http://svn.apache.org/viewvc?rev=1766538&view=rev
Log:
Fail earlier if trailer headers don't end the stream

Modified:
tomcat/tc8.5.x/trunk/   (props changed)
tomcat/tc8.5.x/trunk/java/org/apache/coyote/http2/Http2Parser.java
tomcat/tc8.5.x/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java
tomcat/tc8.5.x/trunk/java/org/apache/coyote/http2/LocalStrings.properties
tomcat/tc8.5.x/trunk/java/org/apache/coyote/http2/Stream.java
tomcat/tc8.5.x/trunk/test/org/apache/coyote/http2/Http2TestBase.java

Propchange: tomcat/tc8.5.x/trunk/
--
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Oct 25 14:17:49 2016
@@ -1 +1 @@
-/tomcat/trunk:1734785,1734799,1734845,1734928,1735041,1735044,1735480,1735577,1735597,1735599-1735600,1735615,1736145,1736162,1736209,1736280,1736297,1736299,1736489,1736646,1736703,1736836,1736849,1737104-1737105,1737112,1737117,1737119-1737120,1737155,1737157,1737192,1737280,1737339,1737632,1737664,1737715,1737748,1737785,1737834,1737860,1737903,1737959,1738005,1738007,1738014-1738015,1738018,1738022,1738039,1738043,1738059-1738060,1738147,1738149,1738174-1738175,1738261,1738589,1738623-1738625,1738643,1738816,1738850,1738855,1738946-1738948,1738953-1738954,1738979,1738982,1739079-1739081,1739087,1739113,1739153,1739172,1739176,1739191,1739474,1739726,1739762,1739775,1739814,1739817-1739818,1739975,1740131,1740324,1740465,1740495,1740508-1740509,1740520,1740535,1740707,1740803,1740810,1740969,1740980,1740991,1740997,1741015,1741033,1741036,1741058,1741060,1741080,1741147,1741159,1741164,1741173,1741181,1741190,1741197,1741202,1741208,1741213,1741221,1741225,1741232,1741409,1741501
 
,1741677,1741892,1741896,1741984,1742023,1742042,1742071,1742090,1742093,1742101,1742105,1742111,1742139,1742146,1742148,1742166,1742181,1742184,1742187,1742246,1742248-1742251,1742263-1742264,1742268,1742276,1742369,1742387,1742448,1742509-1742512,1742917,1742919,1742933,1742975-1742976,1742984,1742986,1743019,1743115,1743117,1743124-1743125,1743134,1743425,1743554,1743679,1743696-1743698,1743700-1743701,1744058,1744064-1744065,1744125,1744194,1744229,1744270,1744323,1744432,1744684,1744697,1744705,1744713,1744760,1744786,1745083,1745142-1745143,1745145,1745177,1745179-1745180,1745227,1745248,1745254,1745337,1745467,1745473,1745576,1745735,1745744,1746304,1746306-1746307,1746319,1746327,1746338,1746340-1746341,1746344,1746427,1746441,1746473,1746490,1746492,1746495-1746496,1746499-1746501,1746503-1746507,1746509,1746549,1746551,1746554,1746556,1746558,1746584,1746620,1746649,1746724,1746939,1746989,1747014,1747028,1747035,1747210,1747225,1747234,1747253,1747404,1747506,1747536,1747
 
924,1747980,1747993,1748001,1748253,1748452,1748547,1748629,1748676,1748715,1749287,1749296,1749328,1749373,1749465,1749506,1749508,1749665-1749666,1749763,1749865-1749866,1749898,1749978,1749980,1750011,1750015,1750056,1750480,1750617,1750634,1750692,1750697,1750700,1750703,1750707,1750714,1750718,1750723,1750774,1750899,1750975,1750995,1751061,1751097,1751173,1751438,1751447,1751463,1751702,1752212,1752737,1752745,1753078,1753080,1753358,1753363,1754111,1754140-1754141,1754281,1754310,1754445,1754467,1754494,1754496,1754528,1754532-1754533,1754613,1754714,1754874,1754941,1754944,1754950-1754951,1755005,1755007,1755009,1755132,1755180-1755181,1755185,1755190,1755204-1755206,1755208,1755214,1755224,1755227,1755230,1755629,1755646-1755647,1755650,1755653,1755675,1755680,1755683,1755693,1755717,1755731-1755737,1755812,1755828,1755884,1755890,1755918-1755919,1755942,1755958,1755960,1755970,1755993,1756013,1756019,1756039,1756056,1756083-1756114,1756175,1756288-1756289,1756408-1756410,1
 
756778,1756798,1756878,1756898,1756939,1757123-1757124,1757126,1757128,1757132-1757133,1757136,1757145,1757167-1757168,1757175,1757180,1757182,1757195,1757271,1757278,1757347,1757353-1757354,1757363,1757374,1757399,1757406,1757408,1757485,1757495,1757499,1757527,1757578,1757684,1757722,1757727,1757853,1757903,1757997,1758072-1758075,1758078-1758079,1758292,1758369,1758423,1758425-1758427,1758430,1758459,1758483,1758486-1758487,1758499,1758525,1758556,1758582,1758584,1758588,1758842,1759019,1759212,1759224,1759227,1759252,1759274,1759513-1759516,1759611,1760005,1760022,1760300,1760397,1760446,1760454,1760640,1760648,1761057,1761422,1761491,1761498,1761500-1761501,1761550,1761553,1761572,1761574,1761625-1761626,1761628,1761682,1761740,1761752,1762123,1762168,1762172,1762182,1762202,1762288,1762296,1762348,1762353,1762374,1762503,1762505,1762541,1762608,1762710,1762753,1762766,1762769,1762944,1762947,1762953,1763167,1763179,1763232,1763259,1763271-1763272,1763276-1763277,1763319-176332
 
0,1763370,1763372,1763375,1763377,1763393,1763412,1763430,1763450,1763512,1763516,1763518,1763520,1763529,1763574,1763634-1763635,1763718,1763786,1763798-1763799,1764083,1764425,1764646,1764648-176

Re: TC 8.5 and Log4J2 via Juli: Wrong location info

2016-10-25 Thread Rémy Maucherat
2016-10-25 16:11 GMT+02:00 Rainer Jung :

> Am 25.10.2016 um 15:49 schrieb Rémy Maucherat:
>
>> 2016-10-25 15:33 GMT+02:00 Romain Manni-Bucau :
>>
>> Hi guys,
>>>
>>> since now tomcat has Log API as a SPI doing 2 is easy (
>>> http://svn.apache.org/repos/asf/openwebbeans/microwave/
>>> trunk/microwave-core/src/main/java/org/apache/microwave/
>>> logging/tomcat/Log4j2Log.java)
>>> and
>>> just a drop-in jar setup so not sure it needs to be in tomcat default
>>> delivery.
>>>
>>
> I see. This sounds pretty simple.
>
> But if this is enough and done through reflection, it avoids the
>> dependency too.
>>
>
> Just that I understand: you mean the dependency on the Log4J jul bridge?
> Or some other dependency?
>

Yes, that's based on the example that was given, if the idea is to provide
support for more logging frameworks:
http://svn.apache.org/repos/asf/openwebbeans/microwave/trunk/microwave-core/src/main/java/org/apache/microwave/logging/tomcat/Log4j2Log.java

Rémy


Re: TC 8.5 and Log4J2 via Juli: Wrong location info

2016-10-25 Thread Rainer Jung

Am 25.10.2016 um 15:33 schrieb Romain Manni-Bucau:

Hi guys,

since now tomcat has Log API as a SPI doing 2 is easy (
http://svn.apache.org/repos/asf/openwebbeans/microwave/trunk/microwave-core/src/main/java/org/apache/microwave/logging/tomcat/Log4j2Log.java)
and
just a drop-in jar setup so not sure it needs to be in tomcat default
delivery.


I tried to plug in Log4j2Log.java using SPI. It gets used, but it 
doesn't fix the problem. Now the location info points to Log4j2Log 
instead of DirectJDKLog. The Problem of one indirection layer to much 
above Log4Js has't changed.


I think the jul log bridge removes one frame, which is the jul loger, 
ending up taking the DirectJDKLog which vcalls the jul logger as its 
location. Using your approach does no longer use jul, so log4j2 doesn't 
re move a frame and again takes the wrong class Log4j2Log as its 
location info.


I think delegating is not enough, you actually need to implement the 
target API or extend a target implementation.


Did you check the location info using the SPI approach?

Regards,

Rainer

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: TC 8.5 and Log4J2 via Juli: Wrong location info

2016-10-25 Thread Romain Manni-Bucau
This has the issue but the fix is easy and 100% belonging to the Log impl
jar:
http://svn.apache.org/repos/asf/openwebbeans/microwave/trunk/microwave-core/src/main/java/org/apache/microwave/logging/log4j2/MicrowaveLogEventFactory.java
and
http://svn.apache.org/repos/asf/openwebbeans/microwave/trunk/microwave-core/src/main/resources/log4j2.component.properties


Romain Manni-Bucau
@rmannibucau  |  Blog
 | Old Wordpress Blog
 | Github  |
LinkedIn  | Tomitriber
 | JavaEE Factory


2016-10-25 16:38 GMT+02:00 Rainer Jung :

> Am 25.10.2016 um 15:33 schrieb Romain Manni-Bucau:
>
>> Hi guys,
>>
>> since now tomcat has Log API as a SPI doing 2 is easy (
>> http://svn.apache.org/repos/asf/openwebbeans/microwave/trunk
>> /microwave-core/src/main/java/org/apache/microwave/logging/
>> tomcat/Log4j2Log.java)
>> and
>> just a drop-in jar setup so not sure it needs to be in tomcat default
>> delivery.
>>
>
> I tried to plug in Log4j2Log.java using SPI. It gets used, but it doesn't
> fix the problem. Now the location info points to Log4j2Log instead of
> DirectJDKLog. The Problem of one indirection layer to much above Log4Js
> has't changed.
>
> I think the jul log bridge removes one frame, which is the jul loger,
> ending up taking the DirectJDKLog which vcalls the jul logger as its
> location. Using your approach does no longer use jul, so log4j2 doesn't re
> move a frame and again takes the wrong class Log4j2Log as its location info.
>
> I think delegating is not enough, you actually need to implement the
> target API or extend a target implementation.
>
> Did you check the location info using the SPI approach?
>
> Regards,
>
> Rainer
>
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>
>


Re: TC 8.5 and Log4J2 via Juli: Wrong location info

2016-10-25 Thread Rainer Jung

Am 25.10.2016 um 17:07 schrieb Romain Manni-Bucau:

This has the issue but the fix is easy and 100% belonging to the Log impl
jar:
http://svn.apache.org/repos/asf/openwebbeans/microwave/trunk/microwave-core/src/main/java/org/apache/microwave/logging/log4j2/MicrowaveLogEventFactory.java
and
http://svn.apache.org/repos/asf/openwebbeans/microwave/trunk/microwave-core/src/main/resources/log4j2.component.properties


Romain Manni-Bucau
@rmannibucau  |  Blog
 | Old Wordpress Blog
 | Github  |
LinkedIn  | Tomitriber
 | JavaEE Factory


2016-10-25 16:38 GMT+02:00 Rainer Jung :


Am 25.10.2016 um 15:33 schrieb Romain Manni-Bucau:


Hi guys,

since now tomcat has Log API as a SPI doing 2 is easy (
http://svn.apache.org/repos/asf/openwebbeans/microwave/trunk
/microwave-core/src/main/java/org/apache/microwave/logging/
tomcat/Log4j2Log.java)
and
just a drop-in jar setup so not sure it needs to be in tomcat default
delivery.



I tried to plug in Log4j2Log.java using SPI. It gets used, but it doesn't
fix the problem. Now the location info points to Log4j2Log instead of
DirectJDKLog. The Problem of one indirection layer to much above Log4Js
has't changed.

I think the jul log bridge removes one frame, which is the jul loger,
ending up taking the DirectJDKLog which vcalls the jul logger as its
location. Using your approach does no longer use jul, so log4j2 doesn't re
move a frame and again takes the wrong class Log4j2Log as its location info.

I think delegating is not enough, you actually need to implement the
target API or extend a target implementation.

Did you check the location info using the SPI approach?

Regards,

Rainer


Thanks for that hint. Actually I hadn't noticed this trick to overwrite 
the getSource() logic.


I'm not sure though, how dangerous this is due to possible effects on 
Log4J2 in some webapp. IMHO the alternative LogEvent and LogEventFactory 
impl must be made available for Tomcat use already in the CLASSPATH. The 
server loader could already be too late. That means it is also visible 
to any webapp. And activating it is done either via a system property, 
or a resource named log4j2.component.properties which contains the property


Log4jLogEventFactory=org.apache.juli.JuliLogEventFactory

Again this resource IMHO must reside in the CLASSPATH. So both ways of 
activating the alternative LogEvent impl also activate it for any Log4J2 
in any webapp.


Although the code of the LogEvent looks compatible with the standard 
one, this is only true as long as we consider Log4jLogEvent being the 
standard one. Unfortunately the Log4J2 class LoggerConfig can use 
DefaultLogEventFactory (which indeed uses Log4jLogEvent) but also 
ReusableLogEventFactory, which uses thread-local MutableLogEvent.


So I'm not sure how safe this replacement is.

For anyone who wants to experiment here's what I did:

- create file log4j2.component.properties with the single line:

Log4jLogEventFactory=org.apache.juli.JuliLogEventFactory

- create class JuliLogEventFactory.java very similar to the one Romain 
created. I'll paste it inline further down.


- Put the class and the properties file into some new jar 
(tomcat-juli.jar should also work)


- Add the new jar and from Log4J2 log4j-api.jar, log4j-core.jar and 
log4j-jul.jar to the CLASSPATH


- Add a Log4J2 config (I have added its location to CLASSPATH)

- Set

LOGGING_MANAGER="-Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager"

As a result the logged location info now works although the jul bridge 
is being used. But as said above, I'm not so sure about dangers for 
webapp provided Log4J2. Note that not using the jul bridge by Romain's 
SPI idea still needs a very similar location info fix. So we can split 
the discussion about how to fix location info from the discussion 
whether we prefer the jul bridge or a tomcat provided Log4J2 logger via SPI.


For the sake of completeness, here's the call stack we need to handle to 
find the location info when using the Log4J2 jul bridge:


...
org.apache.logging.log4j.core.Logger.logMessage(Logger.java:147)
org.apache.logging.log4j.spi.ExtendedLoggerWrapper.logMessage(ExtendedLoggerWrapper.java:217)
org.apache.logging.log4j.spi.AbstractLogger.logMessage(AbstractLogger.java:1993)
org.apache.logging.log4j.spi.AbstractLogger.logIfEnabled(AbstractLogger.java:1852)
org.apache.logging.log4j.jul.WrappedLogger.log(WrappedLogger.java:50)
org.apache.logging.log4j.jul.ApiLogger.log(ApiLogger.java:112)
org.apache.logging.log4j.jul.ApiLogger.logp(ApiLogger.java:132)
org.apache.juli.logging.DirectJDKLog.log(DirectJDKLog.java:179)
org.apache.juli.logging.DirectJDKLog.info(DirectJDKLog.java:122)
-> here comes the wanted location
...

Regards,

Rainer

Class org.apache.juli.JuliL

Re: TC 8.5 and Log4J2 via Juli: Wrong location info

2016-10-25 Thread Romain Manni-Bucau
2016-10-25 22:35 GMT+02:00 Rainer Jung :

> Am 25.10.2016 um 17:07 schrieb Romain Manni-Bucau:
>
>> This has the issue but the fix is easy and 100% belonging to the Log impl
>> jar:
>> http://svn.apache.org/repos/asf/openwebbeans/microwave/trunk
>> /microwave-core/src/main/java/org/apache/microwave/logging/
>> log4j2/MicrowaveLogEventFactory.java
>> and
>> http://svn.apache.org/repos/asf/openwebbeans/microwave/trunk
>> /microwave-core/src/main/resources/log4j2.component.properties
>>
>>
>> Romain Manni-Bucau
>> @rmannibucau  |  Blog
>>  | Old Wordpress Blog
>>  | Github <
>> https://github.com/rmannibucau> |
>> LinkedIn  | Tomitriber
>>  | JavaEE Factory
>> 
>>
>> 2016-10-25 16:38 GMT+02:00 Rainer Jung :
>>
>> Am 25.10.2016 um 15:33 schrieb Romain Manni-Bucau:
>>>
>>> Hi guys,

 since now tomcat has Log API as a SPI doing 2 is easy (
 http://svn.apache.org/repos/asf/openwebbeans/microwave/trunk
 /microwave-core/src/main/java/org/apache/microwave/logging/
 tomcat/Log4j2Log.java)
 and
 just a drop-in jar setup so not sure it needs to be in tomcat default
 delivery.


>>> I tried to plug in Log4j2Log.java using SPI. It gets used, but it doesn't
>>> fix the problem. Now the location info points to Log4j2Log instead of
>>> DirectJDKLog. The Problem of one indirection layer to much above Log4Js
>>> has't changed.
>>>
>>> I think the jul log bridge removes one frame, which is the jul loger,
>>> ending up taking the DirectJDKLog which vcalls the jul logger as its
>>> location. Using your approach does no longer use jul, so log4j2 doesn't
>>> re
>>> move a frame and again takes the wrong class Log4j2Log as its location
>>> info.
>>>
>>> I think delegating is not enough, you actually need to implement the
>>> target API or extend a target implementation.
>>>
>>> Did you check the location info using the SPI approach?
>>>
>>> Regards,
>>>
>>> Rainer
>>>
>>
> Thanks for that hint. Actually I hadn't noticed this trick to overwrite
> the getSource() logic.
>
> I'm not sure though, how dangerous this is due to possible effects on
> Log4J2 in some webapp. IMHO the alternative LogEvent and LogEventFactory
> impl must be made available for Tomcat use already in the CLASSPATH. The
> server loader could already be too late. That means it is also visible to
> any webapp. And activating it is done either via a system property, or a
> resource named log4j2.component.properties which contains the property
>
> Log4jLogEventFactory=org.apache.juli.JuliLogEventFactory
>
> Again this resource IMHO must reside in the CLASSPATH. So both ways of
> activating the alternative LogEvent impl also activate it for any Log4J2 in
> any webapp.
>
>
True or not, nothing prevents to run it in a logger classloader to isolate
from webapp. That said if you want tomcat to log with log4j2 you likely
also want the webapps to do the same IMO. Also tomcat has a classloader
context selector so config can be per webapp or at least hook is there for
that.


> Although the code of the LogEvent looks compatible with the standard one,
> this is only true as long as we consider Log4jLogEvent being the standard
> one. Unfortunately the Log4J2 class LoggerConfig can use
> DefaultLogEventFactory (which indeed uses Log4jLogEvent) but also
> ReusableLogEventFactory, which uses thread-local MutableLogEvent.
>
> So I'm not sure how safe this replacement is.
>
>
the properties config enforces it. It can get more config love but think it
already works not bad.


> For anyone who wants to experiment here's what I did:
>
> - create file log4j2.component.properties with the single line:
>
> Log4jLogEventFactory=org.apache.juli.JuliLogEventFactory
>
> - create class JuliLogEventFactory.java very similar to the one Romain
> created. I'll paste it inline further down.
>
> - Put the class and the properties file into some new jar (tomcat-juli.jar
> should also work)
>
> - Add the new jar and from Log4J2 log4j-api.jar, log4j-core.jar and
> log4j-jul.jar to the CLASSPATH
>
> - Add a Log4J2 config (I have added its location to CLASSPATH)
>
> - Set
>
> LOGGING_MANAGER="-Djava.util.logging.manager=org.apache.logg
> ing.log4j.jul.LogManager"
>
> As a result the logged location info now works although the jul bridge is
> being used. But as said above, I'm not so sure about dangers for webapp
> provided Log4J2. Note that not using the jul bridge by Romain's SPI idea
> still needs a very similar location info fix. So we can split the
> discussion about how to fix location info from the discussion whether we
> prefer the jul bridge or a tomcat provided Log4J2 logger via SPI.
>
> For the sake of completeness, here's the call stack we need to handle to
> find the location info when using the Log4J2 jul bridge:
>
> ...
> org.apache.logg

[Bug 60202] Failed LDAP connection triggers lockout realm

2016-10-25 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=60202

--- Comment #16 from Ben  ---
(In reply to Remy Maucherat from comment #15)
> (In reply to Ben from comment #14)
> > That looks like a pretty elegant solution. How would it interact with
> > third-party realms?
> 
> A third party realm would have to implement the new API method.

Last question (bear with me since I'm not a developer):
Am I correct that the default isAvailable() you added in Realm.java would
return true if a 3rd-party realm did not have its own isAvailable() method?

If so, this looks like minimal fallout and a good solution to my problem. I'll
defer to the community on whether to accept the change but it has my vote.

-- 
You are receiving this mail because:
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 60297] Tomcat.setConnector not using supplied connector

2016-10-25 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=60297

--- Comment #6 from Axel U  ---
I am suggesting not porting it to 8.0.x and 7.0.x.

-- 
You are receiving this mail because:
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: TC 8.5 and Log4J2 via Juli: Wrong location info

2016-10-25 Thread Rainer Jung

Am 25.10.2016 um 22:40 schrieb Romain Manni-Bucau:

2016-10-25 22:35 GMT+02:00 Rainer Jung :


Am 25.10.2016 um 17:07 schrieb Romain Manni-Bucau:


This has the issue but the fix is easy and 100% belonging to the Log impl
jar:
http://svn.apache.org/repos/asf/openwebbeans/microwave/trunk
/microwave-core/src/main/java/org/apache/microwave/logging/
log4j2/MicrowaveLogEventFactory.java
and
http://svn.apache.org/repos/asf/openwebbeans/microwave/trunk
/microwave-core/src/main/resources/log4j2.component.properties


Romain Manni-Bucau
@rmannibucau  |  Blog
 | Old Wordpress Blog
 | Github <
https://github.com/rmannibucau> |
LinkedIn  | Tomitriber
 | JavaEE Factory


2016-10-25 16:38 GMT+02:00 Rainer Jung :

Am 25.10.2016 um 15:33 schrieb Romain Manni-Bucau:


Hi guys,


since now tomcat has Log API as a SPI doing 2 is easy (
http://svn.apache.org/repos/asf/openwebbeans/microwave/trunk
/microwave-core/src/main/java/org/apache/microwave/logging/
tomcat/Log4j2Log.java)
and
just a drop-in jar setup so not sure it needs to be in tomcat default
delivery.



I tried to plug in Log4j2Log.java using SPI. It gets used, but it doesn't
fix the problem. Now the location info points to Log4j2Log instead of
DirectJDKLog. The Problem of one indirection layer to much above Log4Js
has't changed.

I think the jul log bridge removes one frame, which is the jul loger,
ending up taking the DirectJDKLog which vcalls the jul logger as its
location. Using your approach does no longer use jul, so log4j2 doesn't
re
move a frame and again takes the wrong class Log4j2Log as its location
info.

I think delegating is not enough, you actually need to implement the
target API or extend a target implementation.

Did you check the location info using the SPI approach?

Regards,

Rainer




Thanks for that hint. Actually I hadn't noticed this trick to overwrite
the getSource() logic.

I'm not sure though, how dangerous this is due to possible effects on
Log4J2 in some webapp. IMHO the alternative LogEvent and LogEventFactory
impl must be made available for Tomcat use already in the CLASSPATH. The
server loader could already be too late. That means it is also visible to
any webapp. And activating it is done either via a system property, or a
resource named log4j2.component.properties which contains the property

Log4jLogEventFactory=org.apache.juli.JuliLogEventFactory

Again this resource IMHO must reside in the CLASSPATH. So both ways of
activating the alternative LogEvent impl also activate it for any Log4J2 in
any webapp.



True or not, nothing prevents to run it in a logger classloader to isolate
from webapp. That said if you want tomcat to log with log4j2 you likely
also want the webapps to do the same IMO. Also tomcat has a classloader
context selector so config can be per webapp or at least hook is there for
that.


I was more concerned about a webapp that does not use juli, but uses 
Log4J2 directly (or via SLF4J etc.). We should not disturb the behavior 
of such a webapp by our Tomcat log setup.


Using a specific class loader for loading TC logging resources/config 
might work (although it will have the usual problem, that logging isn't 
set up correctly before the loader is in place). Setting it up as I 
described it might have side effects on deployed webapps due to 
delegation rules. I'll try to find time to check this.



Although the code of the LogEvent looks compatible with the standard one,
this is only true as long as we consider Log4jLogEvent being the standard
one. Unfortunately the Log4J2 class LoggerConfig can use
DefaultLogEventFactory (which indeed uses Log4jLogEvent) but also
ReusableLogEventFactory, which uses thread-local MutableLogEvent.

So I'm not sure how safe this replacement is.



the properties config enforces it. It can get more config love but think it
already works not bad.


By "safe" I did not mean whether it will work in any case, but whether 
it can disturb deployed contexts.



For anyone who wants to experiment here's what I did:

- create file log4j2.component.properties with the single line:

Log4jLogEventFactory=org.apache.juli.JuliLogEventFactory

- create class JuliLogEventFactory.java very similar to the one Romain
created. I'll paste it inline further down.

- Put the class and the properties file into some new jar (tomcat-juli.jar
should also work)

- Add the new jar and from Log4J2 log4j-api.jar, log4j-core.jar and
log4j-jul.jar to the CLASSPATH

- Add a Log4J2 config (I have added its location to CLASSPATH)

- Set

LOGGING_MANAGER="-Djava.util.logging.manager=org.apache.logg
ing.log4j.jul.LogManager"

As a result the logged location info now works although the jul bridge is
being used. But as said above, I'm not so sure about dangers for webapp
provided Log4J2. Note that not usin

Re: TC 8.5 and Log4J2 via Juli: Wrong location info

2016-10-25 Thread Romain Manni-Bucau
2016-10-26 8:26 GMT+02:00 Rainer Jung :

> Am 25.10.2016 um 22:40 schrieb Romain Manni-Bucau:
>
>> 2016-10-25 22:35 GMT+02:00 Rainer Jung :
>>
>> Am 25.10.2016 um 17:07 schrieb Romain Manni-Bucau:
>>>
>>> This has the issue but the fix is easy and 100% belonging to the Log impl
 jar:
 http://svn.apache.org/repos/asf/openwebbeans/microwave/trunk
 /microwave-core/src/main/java/org/apache/microwave/logging/
 log4j2/MicrowaveLogEventFactory.java
 and
 http://svn.apache.org/repos/asf/openwebbeans/microwave/trunk
 /microwave-core/src/main/resources/log4j2.component.properties


 Romain Manni-Bucau
 @rmannibucau  |  Blog
  | Old Wordpress Blog
  | Github <
 https://github.com/rmannibucau> |
 LinkedIn  | Tomitriber
  | JavaEE Factory
 

 2016-10-25 16:38 GMT+02:00 Rainer Jung :

 Am 25.10.2016 um 15:33 schrieb Romain Manni-Bucau:

>
> Hi guys,
>
>>
>> since now tomcat has Log API as a SPI doing 2 is easy (
>> http://svn.apache.org/repos/asf/openwebbeans/microwave/trunk
>> /microwave-core/src/main/java/org/apache/microwave/logging/
>> tomcat/Log4j2Log.java)
>> and
>> just a drop-in jar setup so not sure it needs to be in tomcat default
>> delivery.
>>
>>
>> I tried to plug in Log4j2Log.java using SPI. It gets used, but it
> doesn't
> fix the problem. Now the location info points to Log4j2Log instead of
> DirectJDKLog. The Problem of one indirection layer to much above Log4Js
> has't changed.
>
> I think the jul log bridge removes one frame, which is the jul loger,
> ending up taking the DirectJDKLog which vcalls the jul logger as its
> location. Using your approach does no longer use jul, so log4j2 doesn't
> re
> move a frame and again takes the wrong class Log4j2Log as its location
> info.
>
> I think delegating is not enough, you actually need to implement the
> target API or extend a target implementation.
>
> Did you check the location info using the SPI approach?
>
> Regards,
>
> Rainer
>
>
 Thanks for that hint. Actually I hadn't noticed this trick to overwrite
>>> the getSource() logic.
>>>
>>> I'm not sure though, how dangerous this is due to possible effects on
>>> Log4J2 in some webapp. IMHO the alternative LogEvent and LogEventFactory
>>> impl must be made available for Tomcat use already in the CLASSPATH. The
>>> server loader could already be too late. That means it is also visible to
>>> any webapp. And activating it is done either via a system property, or a
>>> resource named log4j2.component.properties which contains the property
>>>
>>> Log4jLogEventFactory=org.apache.juli.JuliLogEventFactory
>>>
>>> Again this resource IMHO must reside in the CLASSPATH. So both ways of
>>> activating the alternative LogEvent impl also activate it for any Log4J2
>>> in
>>> any webapp.
>>>
>>>
>>> True or not, nothing prevents to run it in a logger classloader to
>> isolate
>> from webapp. That said if you want tomcat to log with log4j2 you likely
>> also want the webapps to do the same IMO. Also tomcat has a classloader
>> context selector so config can be per webapp or at least hook is there for
>> that.
>>
>
> I was more concerned about a webapp that does not use juli, but uses
> Log4J2 directly (or via SLF4J etc.). We should not disturb the behavior of
> such a webapp by our Tomcat log setup.
>
>
Yes Tomcat is not yet able to filter resources by classloader (Loader could
get a config for that with defaults, we do it in tomee for slf4j and
several specs for instance)


> Using a specific class loader for loading TC logging resources/config
> might work (although it will have the usual problem, that logging isn't set
> up correctly before the loader is in place). Setting it up as I described
> it might have side effects on deployed webapps due to delegation rules.
> I'll try to find time to check this.
>
>
Should be fine, worse case the constraint would be to do the
LogManager.getLogger lazily which is acceptable for bootstrap loggers (no
runtime performance constraint).


> Although the code of the LogEvent looks compatible with the standard one,
>>> this is only true as long as we consider Log4jLogEvent being the standard
>>> one. Unfortunately the Log4J2 class LoggerConfig can use
>>> DefaultLogEventFactory (which indeed uses Log4jLogEvent) but also
>>> ReusableLogEventFactory, which uses thread-local MutableLogEvent.
>>>
>>> So I'm not sure how safe this replacement is.
>>>
>>>
>>> the properties config enforces it. It can get more config love but think
>> it
>> already works not bad.
>>
>
> By "safe" I did not mean whether it will work in any case, but whether i