A newer release of this product is available.
Manage application logs
Post application log events to the ONTAP system using EMS events, with optional AutoSupport generation based on severity. Retrieve generated events via the EMS events API for monitoring and analysis.
Overview
A POST request allows a standalone application to log its events on the ONTAP system as EMS events and optionally generate AutoSupports. This event information is encapsulated in an app.log.x event, or callhome.client.app.x event in case AutoSupport generation is required, based on the event's severity.
|
|
This API only supports POST. Generated events can be retrieved using the /api/support/ems/events API. |
Examples
Creating a new app.log.* event
The following example generates an app.log.error event.
# The API:
POST /api/support/ems/application-logs
# The call:
curl -X POST "https://<mgmt-ip>/api/support/ems/application-logs" -H "accept: application/hal+json" -H "Content-Type: application/json" -d "{ \"computer_name\": \"W12-R2-DC\", \"event_source\": \"SnapCenter Software\", \"app_version\": \"3.0.0.2373\", \"event_id\": 10001, \"category\": \"error\", \"event_description\": \"Clone split job failed\", \"severity\": \"error\", \"autosupport_required\": false}"
# The response:
201 CREATED
{}
Retrieving a list of events generated by this API
The following example retrieves all app.log.* events.
# The API:
GET /api/support/ems/events
# The call:
curl -X GET "https://<mgmt-ip>/api/support/ems/events?message.name=app.log.*" -H "accept: application/hal+json"
# The response:
200 OK
{
"records": [
{
"node": {
"name": "node1",
"uuid": "d96d5d8d-118a-11ec-aad8-005056bb974c",
"_links": {
"self": {
"href": "/api/cluster/nodes/d96d5d8d-118a-11ec-aad8-005056bb974c"
}
}
},
"index": 7865,
"time": "2021-09-17T09:36:28-04:00",
"message": {
"severity": "emergency",
"name": "app.log.emerg"
},
"log_message": "app.log.emerg: iMac: iPad ipad3: (10001) handheld: TestLine1",
"_links": {
"self": {
"href": "/api/support/ems/events/node1/7865"
}
}
}
],
"num_records": 1,
"_links": {
"self": {
"href": "/api/support/ems/events?message.name=app.log.*"
}
}
}