Alex
Alex

Reputation: 1535

WSO2 ESB TRACE Logging level

i m 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?

Upvotes: 1

Views: 1916

Answers (2)

poohdedoo
poohdedoo

Reputation: 1268

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.

Upvotes: 0

Waruna Perera
Waruna Perera

Reputation: 68

Please follow the official doc provided here.

https://docs.wso2.com/display/ESB470/Setting+Up+Logging

Upvotes: 1

Related Questions