Re: [Log4j] 2.9 release and Java 9

2017-07-13 Thread Matt Sicker
It's also possible that the Android build tools will be updated by the time Java 9 is released (or sometime afterward) to fix this issue. The same goes for the OSGi build tools. On 12 July 2017 at 15:32, Ralph Goers wrote: > I should also stress again that I have not tested this so although it >

Re: [Log4j] 2.9 release and Java 9

2017-07-12 Thread Ralph Goers
I should also stress again that I have not tested this so although it looks like it should work I make no guarantees until it can be tested. Ralph > On Jul 12, 2017, at 1:31 PM, Ralph Goers wrote: > > Yeah, it would be nice to tell Maven/Nexus to use a different artifact when > building for A

Re: [Log4j] 2.9 release and Java 9

2017-07-12 Thread Ralph Goers
Yeah, it would be nice to tell Maven/Nexus to use a different artifact when building for Android but the best we can do is to document it well on the web site. Ralph > On Jul 12, 2017, at 12:49 PM, Mikael Ståldal wrote: > > It looks fine. > > The problem is that Android developers who get a

Re: [Log4j] 2.9 release and Java 9

2017-07-12 Thread Mikael Ståldal
It looks fine. The problem is that Android developers who get a transitive dependency to log4j-api now explicitly have to exclude it, and include log4j-api-android instead. It is not hard to do, but how do we reach out to those Android developers who might not even know what Log4j is (and do

Re: [Log4j] 2.9 release and Java 9

2017-07-12 Thread Mikael Ståldal
Providing trimmed down .jar file is not so important for Android since you always use ProGuard to remove unused classes when building an Android app. It is important to trim stuff that breaks on Android, but not to trim it size-wise. On 2017-07-10 23:40, Matt Sicker wrote: 1. The stack is

Re: [Log4j] 2.9 release and Java 9

2017-07-10 Thread Ralph Goers
> On Jul 10, 2017, at 3:12 PM, Matt Sicker wrote: > > Does the log4j-android module shade in log4j-api or something? If not, we > still have the same exact initial problem of Java 9 classes being in the > jar. It specifically excludes the Java 9 class(es) under META-INF. Ralph

Re: [Log4j] 2.9 release and Java 9

2017-07-10 Thread Matt Sicker
Does the log4j-android module shade in log4j-api or something? If not, we still have the same exact initial problem of Java 9 classes being in the jar. On 10 July 2017 at 17:08, Remko Popma wrote: > I think both Gary and myself had the same misunderstanding about > log4j-api-android. I didn't re

Re: [Log4j] 2.9 release and Java 9

2017-07-10 Thread Matt Sicker
Forgot to add the link: . Lots of people involved. On 10 July 2017 at 17:19, Matt Sicker wrote: > OSGi's biggest contributors are Adobe, Bosch, Deutsche Telekom, Huawei, > IBM, Liferay, NTT, Oracle (surprisingly), Paremus, and Software AG, though > OSGi is

Re: [Log4j] 2.9 release and Java 9

2017-07-10 Thread Matt Sicker
OSGi's biggest contributors are Adobe, Bosch, Deutsche Telekom, Huawei, IBM, Liferay, NTT, Oracle (surprisingly), Paremus, and Software AG, though OSGi is a consortium, so similar to Java, it has a ton of other companies and organizations involved in various components. OSGi has its roots in embedd

Re: [Log4j] 2.9 release and Java 9

2017-07-10 Thread Ralph Goers
> On Jul 10, 2017, at 2:58 PM, Gary Gregory wrote: > > On Mon, Jul 10, 2017 at 2:52 PM, Gary Gregory > wrote: > >> >> >> On Jul 10, 2017 14:40, "Matt Sicker" wrote: >> >> 1. The stack is walked every time the LoggerContext has to be determined >> dynamically. This would be a really shitty

Re: [Log4j] 2.9 release and Java 9

2017-07-10 Thread Remko Popma
I think both Gary and myself had the same misunderstanding about log4j-api-android. I didn't realize it contains a bridge/adapter to the Android logging implementation until you mentioned it. Would `log4j-api-android-impl` be a better name? (Shameless plug) Every java main() method deserves ht

Re: [Log4j] 2.9 release and Java 9

2017-07-10 Thread Matt Sicker
That was just a random example. I can't imagine most of the core appenders are useful in Android, and that includes the ones that use Java SE classes only. On 10 July 2017 at 16:52, Gary Gregory wrote: > On Jul 10, 2017 14:40, "Matt Sicker" wrote: > > 1. The stack is walked every time the Logge

Re: [Log4j] 2.9 release and Java 9

2017-07-10 Thread Matt Sicker
The META-INF directory is the only standardized directory in a jar file that's not supposed to be interpreted as containing code. Sure, there are other -INF directories that other tools make like OSGI-INF, BOOT-INF, WEB-INF, etc. It seems like a logical place. I don't know why the Android plugin sc

Re: [Log4j] 2.9 release and Java 9

2017-07-10 Thread Gary Gregory
On Mon, Jul 10, 2017 at 2:52 PM, Gary Gregory wrote: > > > On Jul 10, 2017 14:40, "Matt Sicker" wrote: > > 1. The stack is walked every time the LoggerContext has to be determined > dynamically. This would be a really shitty tradeoff to remove. > 2. I personally care more about supporting standa

Re: [Log4j] 2.9 release and Java 9

2017-07-10 Thread Gary Gregory
On Jul 10, 2017 14:40, "Matt Sicker" wrote: 1. The stack is walked every time the LoggerContext has to be determined dynamically. This would be a really shitty tradeoff to remove. 2. I personally care more about supporting standard Java than Google's bastardization, so I'm more in support of the

Re: [Log4j] 2.9 release and Java 9

2017-07-10 Thread Matt Sicker
1. The stack is walked every time the LoggerContext has to be determined dynamically. This would be a really shitty tradeoff to remove. 2. I personally care more about supporting standard Java than Google's bastardization, so I'm more in support of the replaceable jar. It also provides a way to giv

Re: [Log4j] 2.9 release and Java 9

2017-07-10 Thread Ralph Goers
I would also like to reiterate that StackWalker has to stay for Java 9. The last time I benchmarked walking the stack in Java 9 was slower than in Java 8 when not using StackWalker. See https://github.com/rgoers/stack-walker-benchmark . Ralph

Re: [Log4j] 2.9 release and Java 9

2017-07-10 Thread Ralph Goers
> On Jul 10, 2017, at 1:31 PM, Gary Gregory wrote: > > A log4j-api-android jar is a terrible idea and confusing: Wouldn't the only > difference with log4j-api be that the Java 9 optimization be absent? If so, > that's a LOT of code duplication for no gain IMO. The KISS solution is a > log4j-api-

Re: [Log4j] 2.9 release and Java 9

2017-07-10 Thread Ralph Goers
> On Jul 10, 2017, at 1:25 PM, Mikael Ståldal wrote: > > Exactly. It would be better with a log4j-api that works on Android and then a > log4j-android module as an alternative to log4j-core. > I would suggest you look at log4j-api-android. It should provide a working implementation of the A

Re: [Log4j] 2.9 release and Java 9

2017-07-10 Thread Ralph Goers
> On Jul 10, 2017, at 1:48 PM, Ralph Goers wrote: > > >> On Jul 10, 2017, at 1:25 PM, Mikael Ståldal wrote: >> >> Exactly. It would be better with a log4j-api that works on Android and then >> a log4j-android module as an alternative to log4j-core. >> > > > I would suggest you look at log

Re: [Log4j] 2.9 release and Java 9

2017-07-10 Thread Gary Gregory
A log4j-api-android jar is a terrible idea and confusing: Wouldn't the only difference with log4j-api be that the Java 9 optimization be absent? If so, that's a LOT of code duplication for no gain IMO. The KISS solution is a log4j-api-java9 jar with the Java 9-specific code, right now, just the one

Re: [Log4j] 2.9 release and Java 9

2017-07-10 Thread Mikael Ståldal
We cannot say "on Android use Log4j 2.8" due to the problems you fixed in https://issues.apache.org/jira/browse/LOG4J2-1926 On 2017-07-10 14:33, Remko Popma wrote: However, I wouldn't mind saying Log4j 2.9 supports Java 9 but not Android; on Android use Log4j 2.8.

Re: [Log4j] 2.9 release and Java 9

2017-07-10 Thread Mikael Ståldal
Exactly. It would be better with a log4j-api that works on Android and then a log4j-android module as an alternative to log4j-core. On 2017-07-10 14:33, Remko Popma wrote: One problem with the log4j-api-android idea is that it doesn't cover other libraries that bring in a dependency to log4j-a

Re: [Log4j] 2.9 release and Java 9

2017-07-10 Thread Apache
As I said before, that can be handled by a dependency swap. Ralph > On Jul 10, 2017, at 5:33 AM, Remko Popma wrote: > > One problem with the log4j-api-android idea is that it doesn't cover other > libraries that bring in a dependency to log4j-api. > > However, I wouldn't mind saying Log4j 2.9

Re: [Log4j] 2.9 release and Java 9

2017-07-10 Thread Remko Popma
One problem with the log4j-api-android idea is that it doesn't cover other libraries that bring in a dependency to log4j-api. However, I wouldn't mind saying Log4j 2.9 supports Java 9 but not Android; on Android use Log4j 2.8. (Shameless plug) Every java main() method deserves http://picocli.inf

Re: [Log4j] 2.9 release and Java 9

2017-07-09 Thread Ralph Goers
It could be a classifier if it was in the log4j-api module, but I created a new module. Ralph > On Jul 9, 2017, at 10:28 PM, Matt Sicker wrote: > > On 9 July 2017 at 18:32, Ralph Goers wrote: > >> >> >>> On Jul 9, 2017, at 1:29 PM, Matt Sicker wrote: >>> >>> Suppose we have an Android-sp

Re: [Log4j] 2.9 release and Java 9

2017-07-09 Thread Matt Sicker
On 9 July 2017 at 18:32, Ralph Goers wrote: > > > > On Jul 9, 2017, at 1:29 PM, Matt Sicker wrote: > > > > Suppose we have an Android-specific api jar. Then when an Android > developer > > gets log4j-api transitively, what now? I don't see normal libraries using > > log4j-api-android or somethin

Re: [Log4j] 2.9 release and Java 9

2017-07-09 Thread Ralph Goers
I created a log4j-api-android module on branch “android”. It contains an AndroidLogger that logs to android.util.Log. I have not built it on Android or tested it. Can you give it a whirl? Ralph > On Jul 9, 2017, at 5:11 PM, Gary Gregory wrote: > > On Jul 9, 2017 16:59, "Ralph Goers" wrote:

Re: [Log4j] 2.9 release and Java 9

2017-07-09 Thread Ralph Goers
> On Jul 9, 2017, at 11:45 AM, Gary Gregory wrote: > > On Sun, Jul 9, 2017 at 10:49 AM, Ralph Goers > wrote: > >> When I investigated logging on android I came to the conclusion that the >> only usable logging that can be done in android is with the implementation >> that Google provides. I ha

Re: [Log4j] 2.9 release and Java 9

2017-07-09 Thread Ralph Goers
> On Jul 9, 2017, at 1:29 PM, Matt Sicker wrote: > > Suppose we have an Android-specific api jar. Then when an Android developer > gets log4j-api transitively, what now? I don't see normal libraries using > log4j-api-android or something instead of the standard one. This would be an android sp

Re: [Log4j] 2.9 release and Java 9

2017-07-09 Thread Gary Gregory
On Jul 9, 2017 16:59, "Ralph Goers" wrote: > On Jul 9, 2017, at 2:42 PM, Gary Gregory wrote: > > On Sun, Jul 9, 2017 at 1:29 PM, Matt Sicker wrote: > >> Suppose we have an Android-specific api jar. Then when an Android developer >> gets log4j-api transitively, what now? I don't see normal libr

Re: [Log4j] 2.9 release and Java 9

2017-07-09 Thread Ralph Goers
> On Jul 9, 2017, at 2:42 PM, Gary Gregory wrote: > > On Sun, Jul 9, 2017 at 1:29 PM, Matt Sicker wrote: > >> Suppose we have an Android-specific api jar. Then when an Android developer >> gets log4j-api transitively, what now? I don't see normal libraries using >> log4j-api-android or somethi

Re: [Log4j] 2.9 release and Java 9

2017-07-09 Thread Gary Gregory
On Sun, Jul 9, 2017 at 1:29 PM, Matt Sicker wrote: > Suppose we have an Android-specific api jar. Then when an Android developer > gets log4j-api transitively, what now? I don't see normal libraries using > log4j-api-android or something instead of the standard one. > I am not advocating for an

Re: [Log4j] 2.9 release and Java 9

2017-07-09 Thread Matt Sicker
Suppose we have an Android-specific api jar. Then when an Android developer gets log4j-api transitively, what now? I don't see normal libraries using log4j-api-android or something instead of the standard one. On 9 July 2017 at 13:45, Gary Gregory wrote: > On Sun, Jul 9, 2017 at 10:49 AM, Ralph

Re: [Log4j] 2.9 release and Java 9

2017-07-09 Thread Gary Gregory
On Sun, Jul 9, 2017 at 10:49 AM, Ralph Goers wrote: > When I investigated logging on android I came to the conclusion that the > only usable logging that can be done in android is with the implementation > that Google provides. I have no problem creating a Log4J jar for android > but I am not wil

Re: [Log4j] 2.9 release and Java 9

2017-07-09 Thread Ralph Goers
When I investigated logging on android I came to the conclusion that the only usable logging that can be done in android is with the implementation that Google provides. I have no problem creating a Log4J jar for android but I am not willing to not support Java 9 to do it. Ralph > On Jul 9, 20

Re: [Log4j] 2.9 release and Java 9

2017-07-09 Thread Gary Gregory
But there is a file system on Android... On Jul 9, 2017 10:15, "Matt Sicker" wrote: > It does seem that the problem is indeed only with log4j-api. While an > Android developer might have some setup to get logging working during > development, that's a separate scenario from simply allowing libra

Re: [Log4j] 2.9 release and Java 9

2017-07-09 Thread Matt Sicker
It does seem that the problem is indeed only with log4j-api. While an Android developer might have some setup to get logging working during development, that's a separate scenario from simply allowing libraries that depend on log4j-api to still work in Android. I do think that log4j-core could be

Re: [Log4j] 2.9 release and Java 9

2017-07-09 Thread Mikael Ståldal
Assume that I am an Android developer. I don't know about Log4j, and I don't care much about logging. I don't care about Java 9. In my Android app I want to use a Java library, which claims to support Android. When I include a dependency to that library in my Gradle build, the build breaks sin

Re: [Log4j] 2.9 release and Java 9

2017-07-09 Thread Apache
What does it mean to support android? You cannot log to a file system and many of our out of the box appender make no sense on a phone. What does having the API work on android mean without an implementation? We have never officially supported android and have just gotten our first Jura issue r

Re: [Log4j] 2.9 release and Java 9

2017-07-09 Thread Mikael Ståldal
No matter what we think about it, many other Java libraries want to be compatible with Android (even though that's not the main target). Some of them also do logging, today often with Log4j 1, SLF4J or commons-logging. If we want them to migrate to Log4j 2 API, then it is important that log4j-

Re: [Log4j] 2.9 release and Java 9

2017-07-09 Thread Remko Popma
* When I said "Java 9 has been on the roadmap" I meant the Log4j 2 roadmap. On Sun, Jul 9, 2017 at 9:15 PM, Remko Popma wrote: > Not sure I agree. Our interest in Android is a very recent thing. We've > done some work with LOG4J2-1926 > , we are

Re: [Log4j] 2.9 release and Java 9

2017-07-09 Thread Remko Popma
Not sure I agree. Our interest in Android is a very recent thing. We've done some work with LOG4J2-1926 , we are still discovering new work and I suspect we will keep discovering new issues as we start to take an in-depth look. If anything, let's m

[Log4j] 2.9 release and Java 9

2017-07-09 Thread Mikael Ståldal
As far as I understand, Java 9 will be released September 21. Now we plan to release Log4j 2.9 before the end of July. Given the problems that Java 9 causes, at least for Android, I suggest that we de-scope the Java 9 specific stuff (StackLocator) from the 2.9 release. It should be possible