问题
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