Search code examples
wso2wso2-identity-server

Enable logging for API calls in wso2 identity server


I am using wso2 Identity server and trying to add a service provider XML file with federated configuration however federated identity provider is not set up in my wso2.

I see the error response code in my application as below:

 {"response": "{\"code\":\"APP-xxxxx\",\"message\":\"Error importing application from XML file.\",\"description\":\"Federated Identity Provider test is not available in the server.\",\"traceId\":\"xxxxxxxxxxx\"}"}

I see this log in the application which is trying to post the xml file to wso2 API to add the service provider however I dont see any log related to this in wso2 identity server logs.

I just see a log which shows service provider is added and than deleted immediately.

How do I enable API call logs in wso2 IS so that the error response can be recorded in wso2 logs as well


Solution

  • Find the log4j2.properties file in your WSO2 IS installation directory.

    You can change the logging level of the API or specific components to DEBUG or TRACE for more detailed logs.

    logger.org-wso2-carbon-identity level = DEBUG
    

    https://is.docs.wso2.com/en/6.1.0/deploy/monitor/work-with-product-observability/#log4j-configs