You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Jure Skelin (JIRA)" <ji...@apache.org> on 2019/07/02 08:49:00 UTC

[jira] [Comment Edited] (LOG4J2-2648) Public Log4j Core implementation of the JUL Logger class.

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

Jure Skelin edited comment on LOG4J2-2648 at 7/2/19 8:48 AM:
-------------------------------------------------------------

As {{java.util.logging.LogManager}} is initialized when web application container gets started. And once initialized, that class never gets initialized again.  That means setting on an application level (like war which is running inside app server) is to late. Right?
So, to use log4j-jul {{LogManager}, it is needed to set it on an application server/conteiner level.
And that solution is not acceptable.

There is something similar in Apache CXF ({{org.apache.cxf.common.logging}} package). But they are using log4j ver1 (not log4j2)



was (Author: skelin):
As {{java.util.logging.LogManager}} is initialized when web application container gets started. And once initialized, that class never gets initialized again.  That means setting on an application level (like war which is running inside app server) is to lata. Right?
So, to use log4j-jul {{LogManager}, it is needed to set it on an application server/conteiner level.
And that solution is not acceptable.

There is something similar in Apache CXF ({{org.apache.cxf.common.logging}} package). But they are using log4j ver1 (not log4j2)


> Public Log4j Core implementation of the JUL Logger class.
> ---------------------------------------------------------
>
>                 Key: LOG4J2-2648
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2648
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: JUL adapter
>            Reporter: Jure Skelin
>            Priority: Major
>
> In Glassfish I would like to do something like this:
> {code}
> public class MyApplication extends ResourceConfig {
>     private static final Logger log = LogManager.getLogger(MyApplication.class);
>     public MigrationApplication() {
>         register(new LoggingFeature(new CoreLogger(log)));
>     }
> }
> {code}
> {{java.util.logging.Logger}} is already implemented by the {{org.apache.logging.log4j.jul.CoreLogger}},
> +but the constructor is package private+.



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