Get Log
Source: OCPP 2.0.1 Part 2 — Specification (Edition 2, 2022-12-15) — Section 1.24 (Messages); Use Case N01 — Retrieve Log Information (Functional Block N. Diagnostics)
Overview
The CSMS sends GetLogRequest to ask the Charging Station to upload a log file (security or diagnostics) to a remote location. The CS responds with GetLogResponse(status, filename?) and then sends progress updates via LogStatusNotification, all sharing the same requestId.
If the CS is already uploading a log when a new request arrives, it SHOULD cancel the ongoing upload and respond with AcceptedCanceled.
Sequence Diagram
CSMS ──── GetLogRequest ────▶ Charging Station
(logType, requestId, log{remoteLocation, oldestTimestamp?, latestTimestamp?},
retries?, retryInterval?)
CSMS ◀─── GetLogResponse ──── Charging Station
(status, filename?, statusInfo?)
(then LogStatusNotificationRequest messages with same requestId)
Initiator
CSMS → Charging Station
Fields
| Field Name | Field Type | Card. | Description |
|---|---|---|---|
| logType | LogEnumType | 1..1 | Required. Type of log file the CS should send. |
| requestId | integer | 1..1 | Required. Id of this request. |
| retries | integer | 0..1 | Optional. Maximum number of upload retries. |
| retryInterval | integer | 0..1 | Optional. Interval (s) between retries. |
| log | LogParametersType | 1..1 | Required. Specifies the requested log and remote location. |
| Field Name | Field Type | Card. | Description |
|---|---|---|---|
| status | LogStatusEnumType | 1..1 | Required. Whether the CS was able to accept the request. |
| filename | string [0..255] | 0..1 | Optional. Name of the log file that will be uploaded. |
| statusInfo | StatusInfoType | 0..1 | Optional. Detailed status information. |
LogParametersType
| Field | Type | Card. | Description |
|---|---|---|---|
| remoteLocation | string [0..512] | 1..1 | Required. URL where the log should be stored. |
| oldestTimestamp | dateTime | 0..1 | Optional. Oldest log entry to include. |
| latestTimestamp | dateTime | 0..1 | Optional. Latest log entry to include. |
LogEnumType values
DiagnosticsLog, SecurityLog.
LogStatusEnumType values
Accepted, Rejected, AcceptedCanceled.
Examples
{
"logType": "SecurityLog",
"requestId": 123,
"retries": 3,
"retryInterval": 60,
"log": {
"remoteLocation": "ftps://logs-user:secret@logs.example.com/uploads/",
"oldestTimestamp": "2026-04-25T00:00:00Z",
"latestTimestamp": "2026-04-27T12:00:00Z"
}
}{
"status": "Accepted",
"filename": "security-log-CP-2026-000123-2026-04-27.log"
}Schema
Source:
schemas/GetLogRequest.json,schemas/GetLogResponse.json(OCPP 2.0.1 FINAL)