How can I enable my application logs (API published in WSO2) in APIM_HOME>/repository/conf/log4j2.properties file? I went through the 3.0.0 documentation (https://apim.docs.wso2.com/en/latest/Administer/ProductAdministration/Monitoring/Logging/setting-up-logging/#setting-up-logging-in-api-manager) and tried to configure logging for my app component, but I'm unable to see the application specific logs in wso2carbon.log.
By using custom mediators I am able to log the complete request/response but I am looking to log all the "log.xxx()" lines I have in my code, based on the log level I set in the log4j2.properties file in WSO2. I use slf4j logger in code so I tried enabling logging for "org.slf4j" package and also tried enabling for my application's specific package, but neither worked (the "applogger" below was added to list of comma separated loggers in the same file:
# application logs
logger.applogger.name = org.slf4j
logger.applogger.level = DEBUG
logger.applogger.name = my.application.package
logger.applogger.level = DEBUG
I also checked these (1, 2) logging related questions on SO but couldn't find a definitive answer that solved my problem. When I tried following this link to enable message tracing from carbon console I get the below error:
error
Cannot set eventing configuration. Backend server may be unavailable.; nested exception is:
org.apache.axis2.AxisFault: unknown - An error has occurred. Please refer the logs for more details.
in logs:
TID: [-1234] [] [2020-02-11 04:56:48,913] ERROR {org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver} - Exception occurred while trying to invoke service method configureEventing java.lang.NullPointerException
at org.wso2.carbon.analytics.message.tracer.handler.conf.RegistryPersistenceManager.updateConfigurationProperty(RegistryPersistenceManager.java:84)
.............................
TID: [-1234] [] [2020-02-11 04:56:48,922] ERROR {org.wso2.carbon.analytics.message.tracer.handler.ui.MessageTracerHandlerAdminClient} - Cannot set eventing configuration. Backend server may be unavailable. org.apache.axis2.AxisFault: unknown
at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:531)