GetLog
Sent by the CSMS to request the Charging Station to upload a log file to a specified location.
Quick Reference
Required Fields
logType LogEnumType Type of log to retrieve: DiagnosticsLog or SecurityLog
requestId integer Unique ID for this log request, used to track via LogStatusNotification
log LogParametersType Parameters specifying where to upload the log
log.remoteLocation string(512) URI where the log should be uploaded (FTP, FTPS, HTTP, HTTPS)
Optional Fields
retries integer Number of upload retry attempts
retryInterval integer Seconds between retry attempts
log.oldestTimestamp string (date-time) Oldest timestamp of log entries to include
log.latestTimestamp string (date-time) Latest timestamp of log entries to include
Example Payload
{
"logType": "DiagnosticsLog",
"requestId": 1,
"log": {
"remoteLocation": "ftp://logs.example.com/station-001/",
"oldestTimestamp": "2024-01-10T00:00:00Z",
"latestTimestamp": "2024-01-15T00:00:00Z"
},
"retries": 3,
"retryInterval": 60
} Example Full Frame
[
2,
"msg-001",
"GetLog",
{
"logType": "DiagnosticsLog",
"requestId": 1,
"log": {
"remoteLocation": "ftp://logs.example.com/station-001/",
"oldestTimestamp": "2024-01-10T00:00:00Z",
"latestTimestamp": "2024-01-15T00:00:00Z"
},
"retries": 3,
"retryInterval": 60
}
]
Format: [MessageType, MessageId, Action, Payload]
Overview
GetLog instructs the Charging Station to upload a log file (diagnostics or security) to a remote server. Progress is tracked via LogStatusNotification.
When to Send
- For remote diagnostics of a misbehaving station
- To collect security audit logs
- During a support incident to gather evidence
Expected Response
status:Accepted,Rejected, orAcceptedCanceled
Progress is reported via LogStatusNotification with status Uploading, Uploaded, or UploadFailure.
Key Differences from OCPP 1.6J
- Replaces
GetDiagnosticsfrom 1.6J - Adds
SecurityLogtype for security audit trails requestIdrequired for tracking- Upload URLs support FTP, FTPS, HTTP, HTTPS
Testing Tips
- Test with a valid FTP server and verify
Uploadednotification - Test with an unreachable server and verify
UploadFailureafter retries - Test requesting a
SecurityLogand verify its contents
Common Errors
TypeConstraintViolation
Cause: logType uses an unsupported value
Solution: Use DiagnosticsLog or SecurityLog
PropertyConstraintViolation
Cause: log.remoteLocation exceeds 512 characters
Solution: Keep the upload URL under 512 characters