You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "Jean-Baptiste Onofré (JIRA)" <ji...@apache.org> on 2017/08/04 10:03:00 UTC

[jira] [Commented] (KARAF-5233) LogService does not work with log4j2

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

Jean-Baptiste Onofré commented on KARAF-5233:
---------------------------------------------

The {{LogServiceImpl}} now uses {{getDelegate()}} where it checks the property and react accordingly:

{code}
    private LogServiceInternal getDelegate(Dictionary<String, Object> config) {
        if (config.get("log4j.rootLogger") != null) {
            return new LogServiceLog4j1Impl(config);
        }
        else if (config.get("log4j2.rootLogger.level") != null) {
            return new LogServiceLog4j2Impl(config);
        }
        else {
            throw new IllegalStateException("Unrecognized configuration");
        }
    }
{code}

We now have two different log service depending of the log4j backend version.

> LogService does not work with log4j2
> ------------------------------------
>
>                 Key: KARAF-5233
>                 URL: https://issues.apache.org/jira/browse/KARAF-5233
>             Project: Karaf
>          Issue Type: Bug
>    Affects Versions: 4.1.1
>            Reporter: Fabian Lange
>            Assignee: Jean-Baptiste Onofré
>
> log:get / log:set and similar do not work with log4j2.
> the reason is that the LogServiceImpl has hardcoded prefixes and assumes a certain property name convention. 
> of course this totally changed with log4j2, making LogServiceImpl quite broken



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)