Troubleshooting the REST api
The REST API uses primarily the integration
and oslc
loggers for the API framework part. Enabling those two loggers to DEBUG
or INFO
provides debugging information. However, the rest APIs always interface with Maximo business objects and other Maximo artifacts, such as security, scripting etc, which have their own loggers. Additionally, you can enable the SQL loggers if the query result is not what the filter clause described.
One option to debug is to use the thread logging functionality, which is integrated with the REST API framework.
Thread logging is enabled on a per user basis within the REST API scope in the Logging application by selecting Configure Custom logging > Thread logging. Choose the context name as “OSLC” and the user name as the “personid” of the user whose REST requests you want to track or debug. Then you can enable the logging with - sql,oslc and integration loggers to start with.
You can also enabling the thread logging by using the following REST API:
POST /oslc/log/enablelogs
Body:
["log4j.logger.maximo.sql","log4j.logger.maximo.oslc","log4j.logger.m aximo.integration"]
This API enables the thread logging for the current user that is logged in for the loggers sql,oslc
and integration. There is another api /oslc/log/enablealllogs that enables all loggers for the user. It is recommended not to set that one right away as it would generate a multiple logs, making is difficult to debug. You can disable this logging by using the following call:
POST /oslc/log/disablealllogs<no request body needed>
As you make the requests with this setup for the desired user, the system keeps track of all the oslc, integration and SQL logs that are generated for that user only. It will not mix the logs with other users or other contexts (other than OSLC) that may also generate logs.
This log can then be accessed by using the REST API call GET /oslc/log
. This API call streams the log to the browser. This log is only for the user who was targeted with thread logging setup and can be accessed by only that user and only for that logged in user session. Once the session is done, this log can still be accessed by the server admin from the server’s working directory, which is a manual process. There is no REST API for that task.