logger with LogBack

I'm trying to disable the wildfly logger and use the SLF4J + LogBack implementation but I can't get it.

When I create an SLF4J logger the wildfly gives me that object: org.jboss.logmanager.LogContex.

I would like to get a LogBack logger instance instead of the default one that wildfly provides me.

I've tryed to disable the wildfly logging subsystem (jboss-deployment-structure.xml) but nothing seems to change that:

<jboss-deployment-structure>  
    <deployment>  
        <exclusions>      
            <module name="org.apache.commons.logging" />      
            <module name="org.apache.log4j" />      
            <module name="org.jboss.logging" />      
            <module name="org.jboss.logging.jul-to-slf4j-stub"
            <module name="org.jboss.logmanager" />      
            <module name="org.jboss.logmanager.log4j" />      
            <module name="org.slf4j" />      
            <module name="org.slf4j.impl" />    
        </exclusions>
    </deployment>
</jboss-deployment-structure>

I've also tryed this:

<?xml version="1.0"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <deployment>
        <exclude-subsystems>
            <subsystem name="logging" />
        </exclude-subsystems>
    </deployment>
    <sub-deployment name="projectname-web.war">
        <exclude-subsystems>
            <subsystem name="logging" />
        </exclude-subsystems>
    </sub-deployment>
    <sub-deployment name="projectname-ejb.jar">
        <exclude-subsystems>
            <subsystem name="logging" />
        </exclude-subsystems>
    </sub-deployment>
</jboss-deployment-structure>

Also this:

<subsystem xmlns="urn:jboss:domain:logging:2.0">                           
    <add-logging-api-dependencies value="false"/>       
</subsystem>

Here are two images with the differences beetween these loggers:

在这里输入图像描述

As you can see, the logger instance is a jboss logger instead of an LogBack.

The following image shows the correct logger outside an wildfly environment:

Nothing seems to work. How I can change this behaviour?

Thanks.

链接地址: http://www.djcxy.com/p/36832.html

上一篇: 面试问题:WPF开发人员

下一篇: 记录器与LogBack