WildFly Logging Profile not working with log4j

我的未来我决定 提交于 2019-12-11 06:14:34

问题


Following JBOSS Example Logging Profile Configuration guide I've created a logging profile on my WildFly10 server.

I've edited my MANIFEST.MF adding

Manifest-Version: 1.0
Logging-Profile: accounts-app-profile

But i can't find logs in jboss.server.log.dir\ejb-trace.log as expected.

This is my log4j.properties

log4j.rootLogger=DEBUG, stdout


# ConsoleAppender.
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d - myApp: %m %n

This is my class:

public class myClass {

    final static Logger logger = Logger.getLogger(myClass.class);

    @ResponseBody
    @RequestMapping(value="/test", method= RequestMethod.GET)
    public String getTest(){

        //logs a debug message
        if(logger.isDebugEnabled()){
            logger.debug("This is debug: ");
        }

        //logs an error message with parameter
        logger.error("This is error : ");


        String result = " this is a test";

        return result;
    }
}

Any hints?

来源:https://stackoverflow.com/questions/43874428/wildfly-logging-profile-not-working-with-log4j

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!