Setting the logging level by using REST Administration APIs

System administrators can set the logging level by using the Eclipse Amlen REST Administration APIs.

You can set the logging level only if the Eclipse Amlen server is running. For more information about starting the Eclipse Amlen server, see Starting, stopping, restarting and viewing the status of the Eclipse Amlen server.
You can set the logging level by using a REST Administration API, or by using the Amlen WebUI. For more information about using the Amlen WebUI to set the logging level, see Setting the logging level by using the GUI.
Use the Eclipse Amlen REST API POST method.
  1. Use the following Eclipse Amlen configuration URI:

    http://<admin-endpoint-IP:Port>/ima/v1/configuration

  2. Provide log level configuration data in the payload of the POST method by using the following schema:
     
    {     
      "<Log type>" : "MIN"|"MAX"|"NORMAL"      
    }
    Where:
    • Log type
      Specifies the type of log file on which you want to set the logging level. Log type can be one of the following values:
      • LogLevel
      • ConnectionLog
      • SecurityLog
      • AdminLog
      • MQConnectivityLog
    The logging level can be set to one of the following values:
    MIN
    A setting of MIN includes only the most important entries.
    MAX
    A setting of MAX includes all entries.
    NORMAL
    A setting of NORMAL includes all important entries.

    The following table show the types of log that are available and the corresponding log files:

    Table 1. A number of log types are available, and these log types are associated with specific log files.
    Log type Log file
    LogLevel imaserver-default.log
    ConnectionLog imaserver-connection.log
    SecurityLog imaserver-security.log
    AdminLog imaserver-admin.log
    MQConnectivityLog imaserver-mqconnectivity.log

    For more information about the logs, see Configuring log files.

The following example shows setting the logging level of imaserver-default.log to MAX:
curl -X POST -H 'Content-Type: application/json' -d  '{ "LogLevel": "MAX" }' http://127.0.0.1:9089/ima/v1/configuration/
The following example shows setting the logging level of imaserver-default.log to NORMAL and imaserver-connection.log to MAX:
curl -X POST -H 'Content-Type: application/json' -d  '{ "LogLevel": "NORMAL", "ConnectionLog": "MAX" }' http://127.0.0.1:9089/ima/v1/configuration/
The following shows an example response to the POST method.

{        
  "Version": "v1",
  "Code": "CWLNA6011",
  "Message": "The requested configuration change has completed successfully."
}