im using WSO2 ESB 4.8.1. I wrote a custom class mediator and now i'm dealing with the logging level. I m using the
org.apache.commons.logging.Log
So in my class:
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class XMLDiogeneUtils {
private static Log log = LogFactory.getLog(XMLDiogeneUtils.class);
public static void initializeXPath() {
log.debug("initializing XPATH");
log.trace("method - initializeXPath()");
...
...
When i change the log level of my class, using the ESB console ---> Monitoring ---> Logging, to the TRACE level, i see that in wso2carbon.out are printed just the DEBUG log lines. No trace. What's the problem?
Should have i to use log4j api?
Please follow the official doc provided here.
The reason for this is you need to enable TRACE level logs for XMLDiogeneUtils logger. You need to go to Carbon Management console -> Go to Configure-> and search for XMLDiogeneUtils logger. And you can enable trace level logs. Since wso2 use apache log4j, we log from INFO logs upwards
Ie (in log4j.properties)
log4j.logger.org.apache=INFO, CARBON_LOGFILE, CARBON_MEMORY
Therefore, you will not see the trace log by default and you need to specifically enable them in either log4j.properties file or in wso2 carbon management console.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.