You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Filipp Gunbin (JIRA)" <ji...@apache.org> on 2019/06/21 09:21:00 UTC

[jira] [Comment Edited] (LOG4J2-2635) Wrong java.version check in ThreadNameCachingStrategy

    [ https://issues.apache.org/jira/browse/LOG4J2-2635?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16869319#comment-16869319 ] 

Filipp Gunbin edited comment on LOG4J2-2635 at 6/21/19 9:20 AM:
----------------------------------------------------------------

Yes, here it is [https://github.com/apache/logging-log4j2/pull/283] . It's against release-2.x because I could not build master. The reason seems to be circular dependency in Maven, "cd log4j-core; mvn dependency:tree" shows this:
{quote}[INFO] +- com.vlkan.log4j2:log4j2-logstash-layout:jar:0.18:test
 [INFO] - com.github.ivandzf:log4j2-custom-layout:jar:1.1.0:compile
 [INFO]    +- org.apache.logging.log4j:log4j-core:jar:3.0.0-SNAPSHOT:compile
{quote}


was (Author: fgunbin):
Yes, here it is [https://github.com/apache/logging-log4j2/pull/283] . It's against release-2.x because I could not build master. The reason seems to be circular dependency in Maven, "cd log4j-core; mvn dependency:tree" shows this:
{code:java}
[INFO] +- com.vlkan.log4j2:log4j2-logstash-layout:jar:0.18:test
[INFO] \- com.github.ivandzf:log4j2-custom-layout:jar:1.1.0:compile
[INFO]    +- org.apache.logging.log4j:log4j-core:jar:3.0.0-SNAPSHOT:compile{code}
 

(

> Wrong java.version check in ThreadNameCachingStrategy
> -----------------------------------------------------
>
>                 Key: LOG4J2-2635
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2635
>             Project: Log4j 2
>          Issue Type: Bug
>            Reporter: Filipp Gunbin
>            Priority: Major
>
> I see this in ThreadNameCachingStrategy.java:
> {code:java}
> final String defaultStrategy = System.getProperty("java.version").compareTo("1.8.0_102") < 0
>         ? "CACHED" // LOG4J2-2052 JDK 8u102 removed the String allocation in Thread.getName()
>         : "UNCACHED";{code}
> This doesn't look right because java.version of, say, "1.8.0_77" compares greater than "1.8.0_102" lexicographically.  This is why I have failed tests when trying to build log4j-core.
> Similar check is also present in AsyncLoggerThreadNameStrategyTest.java.
> This was initially added in https://issues.apache.org/jira/browse/LOG4J2-2052
> [posted this on dev mailing list first, but got no response, so creating issue here]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)