Changing and viewing log location information by using REST Administration APIs

You can send log messages to a file or to a syslog server, and you can view current log location information by using Eclipse Amlen REST Administration APIs.

If you are sending log messages to a syslog server, then all logs will share the same syslog server IP, port and protocol. The protocol can be tcp or udp. Use a different syslog facility to separate messages by component. The LogLocation object cannot be deleted by using the REST API DELETE method. To change the log location, complete the following steps:

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 location configuration data in the payload of the POST method by using the following schema:
     
    "LogLocation" : {     
        "<Log name>" : {      
            "LocationType" : "<type of log location>",      
            "Destination" : "<file name or syslog facility>"    
        }
    } 
    
    where
    Log name
    Specifies the type of log that you want to configure. This value can one of the following values:
    DefaultLog
    Specifies server operation log information.
    ConnectionLog
    Specifies connection-related log information.
    AdminLog
    Specifies administration configuration-related log information.
    MQConnectivityLog
    Specifies MQ connectivity-related log information.
    SecurityLog
    Specifies authentication and authorization related log information.
    LocationType
    Specifies the location that you want to send the log messages to. This value can one of the following values:
    file
    If LocationType is set to file, the destination must either specify a valid writeable file name, or specify a reserved name.
    You can specify reserved names of either stdout for standard output, or stderr for standard error.
    syslog
    If LocationType is set to syslog, the destination must specify a syslog facility. The syslog facility can be in the range of 0 through 23. If a facility is not specified, the destination is assumed to be a file name.
    Note:

    To use Docker logging drivers, including json-file, syslog, and gelf, the log location must be set to stdout. This setting enables the use of all Docker logging functionality, including log file rotation for a json-file logging driver. For more information about Docker see Eclipse Amlen in Containers.

You can view log location information by using the Eclipse Amlen REST API GET method with the following Eclipse Amlen configuration URI:

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

The following example displays log location information by using cURL:

curl -X GET http://127.0.0.1:9089/ima/v1/configuration/LogLocation

An example response to the GET method:


{
  "Version": "v1",
  "LogLocation": {
    "DefaultLog": {
      "LocationType": "file",
      "Destination": "/var/messagesight/diag/logs/imaserver-default.log"
    },
    "ConnectionLog": {
      "LocationType": "file",
      "Destination": "/var/messagesight/diag/logs/imaserver-connection.log"
    },
    "AdminLog": {
      "LocationType": "file",
      "Destination": "/var/messagesight/diag/logs/imaserver-admin.log"
    },
    "SecurityLog": {
      "LocationType": "file",
      "Destination": "/var/messagesight/diag/logs/imaserver-security.log"
    },
    "MQConnectivityLog": {
      "LocationType": "file",
      "Destination": "/var/messagesight/diag/logs/imaserver-mqconnectivity.log"
    }
  }
}