GetLog

FirmwareManagement CSMS->CS OCPP 2.0.1

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, or AcceptedCanceled

Progress is reported via LogStatusNotification with status Uploading, Uploaded, or UploadFailure.

Key Differences from OCPP 1.6J

  • Replaces GetDiagnostics from 1.6J
  • Adds SecurityLog type for security audit trails
  • requestId required for tracking
  • Upload URLs support FTP, FTPS, HTTP, HTTPS

Testing Tips

  • Test with a valid FTP server and verify Uploaded notification
  • Test with an unreachable server and verify UploadFailure after retries
  • Test requesting a SecurityLog and 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