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

Romain Manni-Bucau commented on OPENJPA-2842:
---------------------------------------------

[~struberg] ok let's take it simply:

 
 # people are using log4j for v1 and v2 -> so we must keep the most backward 
compatible so v1
 # tomee: it uses it only when log4j1 logger is configured (which comfort point 
1) and it is not the default (which stays JUL).
 # as mentionned 
[https://github.com/struberg/openjpa/commit/21123ac51cb4f62c17df8eff0df476116f3f3f75]
 does not work, tomee is another example (it is common to have both there, same 
in most project bringing spark clients or so, this is why there is no way a 
"guess" algorithm works, you will just pick randomly a logger and likely break 
the infrastructure people put in place to get logs)

So let's make it working for everything, create a log4j2 implementation (add an 
"auto" if you think it makes sense, I think it can) and we are done and 
deterministic. We will only break people using log4j2 in 3.1.0, 3.1.1 and 3.1.2 
which is very few compared to the opposite which is a lot since it had be 
inherited for years (whereas log4j2 is rarely used directly but more through 
slf4j these days). Think it is the less breaking option of the 3.

> openjpa.Log=log4j should automatically switch between log4j-1.x and 2.x
> -----------------------------------------------------------------------
>
>                 Key: OPENJPA-2842
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2842
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: logging
>    Affects Versions: 3.1.2
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>            Priority: Major
>             Fix For: 3.1.3
>
>
> Somewhen in 2018 we added support for log4j2. Sadly we killed log4j-1.x 
> support (which is still widely in use).
>  
> We should automatically detect which version of log4j is available and then 
> use that.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to