MicroStrategy ONE

How to Create Logs to Debug API Issues

You can use logs to better identify and debug API issues. The logs can provide the following information:

  • Name of the class and method being accessed

  • Custom messages used in the code to specify the reason why the message was logged

  • All argument values sent to the method that logged the message

Using the Advanced Logger options explained below, you can determine the specific user and packages for which errors are logged. This makes it easier to debug API issues since each log contains unique information about a specific user, date, and package.

The logs generated by the XML-API Logger are saved in different files from those generated by the Internal diagnostics logger. The XML-API logs are saved in the form of AdvMSTRLog[package][date].log. In the log file name, [date] is replaced by the current date and [package] is replaced by the name of the specific package name for which the log exists.

To create a log to debug API issues

  1. Access the MicroStrategy Web Administrator page. (How?)

  2. From the pane on the left, select Configuration. The Diagnostics Configuration page opens.

  3. Select Internal diagnostic setup.

  4. In the Advanced Logger Options area, select from the following options to disable or enable the creation of XML-API logs, as well as configure how and what information is logged.

    • Disabled: This is the default option. When this option is selected, logs are created using only the default settings you specify in the Internal diagnostics setup options. All errors, warnings, or messages are logged to the log file you specified in the Log files directory, but logs are not created for each specific user, date, and package combination.

    • Enable XML-API Logger: When this option is selected, all messages for a particular user for all calls to the API are logged. These messages consist of any classes that are located under the com.microstrategy.webapi package.

      • User name: To specify that the XML-API logger only saves messages for a specified user, enter the user's name in the text field. If you do not specify a user, messages are logged for all users.

        When the Enable XML-API Loggeroption is selected, you can log only API messages, not messages coming from a specific package or multiple packages. To log information about specific or multiple packages, you must select theEnable logging for multiple/other package(s)option.

    • Enable logging for multiple/other package(s): When this option is selected, you can determine the specific packages for which logs are created. This further refines the logging process because you can more distinctly define which error messages are logged and for which users and packages.

      • Package: To specify certain packages for which to create logs, type the name of the package(s) in the text field. Use a comma to separate the names of multiple packages. For example, you want to log API messages as well as messages for an addons package. In this case, you must list both of these packages by entering the following in the text field: com.microstrategy.webapi, com.microstrategy.web.app.addons

      • User name: To specify that the XML-API logger only saves messages for a specified user, enter the user's name in the text field. If you do not specify a user, messages are logged for all users.

      • Pattern: You can limit the number of logged messages by specifying a pattern. Only messages that match the pattern are logged. For example, you want to log messages that are related only to methods that start with the "getCustomLogin " string. In this case, enter "getCustomLogin* ".

      • Level: You can specify the types of messages that are logged by selecting one of the following options:

        • OFF: Nothing is written in the log file.

        • Errors: This is the default option. Errors are included in the log file.

        • Warnings: Errors and warnings are included in the log file.

        • All: Errors, warnings, and messages are logged.

  5. Click Save.