OCPP 2.0.1 GetLog 메시지

 

GetLog 개요

GetLog는 중앙 시스템(CSMS)에서 충전소로 보내는 로그 파일 요청 메시지입니다. 이 메시지를 통해 CSMS는 충전소의 다양한 로그 파일(보안 로그, 진단 로그 등)을 원격으로 수집하고 분석할 수 있으며, 시스템 모니터링, 문제 진단, 보안 감사 등에 필수적인 기능을 제공합니다.

메시지 구조

Request (CSMS → 충전소)

{
  "logType": "SecurityLog",
  "requestId": 12345,
  "retries": 3,
  "retryInterval": 30,
  "log": {
    "remoteLocation": "https://logs.csms.com/upload/station001/security",
    "oldestTimestamp": "2024-08-15T00:00:00.000Z",
    "latestTimestamp": "2024-08-20T23:59:59.000Z"
  }
}

Response (충전소 → CSMS)

{
  "status": "Accepted",
  "filename": "security_log_20240820_143052.log",
  "statusInfo": {
    "reasonCode": "NoError",
    "additionalInfo": "보안 로그 업로드가 시작되었습니다"
  }
}

주요 필드 설명

Request 필드들

logType 필드 (필수)

설명
DiagnosticsLog 진단 로그 (일반적인 시스템 진단 정보)
SecurityLog 보안 로그 (보안 이벤트 및 감사 정보)

requestId 필드 (필수)

필드명 필수여부 타입 설명
requestId 필수 Integer 고유한 요청 식별자 (LogStatusNotification에서 참조)

retries 필드 (선택사항)

필드명 필수여부 타입 설명
retries 선택사항 Integer 업로드 실패 시 재시도 횟수 (기본값: 3)

retryInterval 필드 (선택사항)

필드명 필수여부 타입 설명
retryInterval 선택사항 Integer 재시도 간격 (초 단위, 기본값: 60)

log 필드 (필수)

필드명 필수여부 타입 설명
remoteLocation 필수 String 로그 파일 업로드 URL
oldestTimestamp 선택사항 DateTime 수집할 로그의 시작 시간
latestTimestamp 선택사항 DateTime 수집할 로그의 종료 시간

Response 필드들

status 필드 (필수)

설명
Accepted 승인됨 - 로그 수집 및 업로드 시작
Rejected 거부됨 - 로그 수집 불가
AcceptedCanceled 승인되었으나 취소됨 - 이전 요청 취소 후 새 요청 수행

filename 필드 (선택사항)

필드명 필수여부 타입 설명
filename 선택사항 String 생성될 로그 파일명 (status가 Accepted인 경우)

statusInfo 필드 (선택사항)

필드명 필수여부 타입 설명
reasonCode 선택사항 String 상태 이유 코드
additionalInfo 선택사항 String 추가 정보

실제 사용 예제

예제 1: 보안 로그 수집 (기간 지정)

// Request
{
  "logType": "SecurityLog",
  "requestId": 12345,
  "retries": 3,
  "retryInterval": 60,
  "log": {
    "remoteLocation": "https://secure-logs.csms.com/upload/station001",
    "oldestTimestamp": "2024-08-15T00:00:00.000Z",
    "latestTimestamp": "2024-08-20T23:59:59.000Z"
  }
}

// Response
{
  "status": "Accepted",
  "filename": "security_log_station001_20240815-20240820.tar.gz",
  "statusInfo": {
    "reasonCode": "NoError",
    "additionalInfo": "보안 로그 수집 시작됨. 예상 파일 크기: 2.3MB"
  }
}

예제 2: 전체 진단 로그 수집

// Request
{
  "logType": "DiagnosticsLog",
  "requestId": 12346,
  "retries": 5,
  "retryInterval": 30,
  "log": {
    "remoteLocation": "https://diagnostics.csms.com/api/v1/upload/logs"
  }
}

// Response
{
  "status": "Accepted",
  "filename": "diagnostics_full_20240820_143052.log",
  "statusInfo": {
    "reasonCode": "NoError",
    "additionalInfo": "전체 진단 로그 수집 중. 완료까지 약 10분 소요 예상"
  }
}

예제 3: 로그 수집 거부 (저장 공간 부족)

// Request
{
  "logType": "DiagnosticsLog",
  "requestId": 12347,
  "log": {
    "remoteLocation": "https://logs.csms.com/upload/emergency"
  }
}

// Response
{
  "status": "Rejected",
  "statusInfo": {
    "reasonCode": "InsufficientStorage",
    "additionalInfo": "로그 압축을 위한 저장 공간이 부족합니다. 사용 가능: 50MB, 필요: 120MB"
  }
}

예제 4: 이전 요청 취소 후 새 요청 수행

// Request
{
  "logType": "SecurityLog",
  "requestId": 12348,
  "retries": 2,
  "retryInterval": 45,
  "log": {
    "remoteLocation": "https://priority-logs.csms.com/urgent-upload",
    "oldestTimestamp": "2024-08-20T12:00:00.000Z",
    "latestTimestamp": "2024-08-20T14:30:00.000Z"
  }
}

// Response
{
  "status": "AcceptedCanceled",
  "filename": "security_urgent_20240820_120000-143000.log",
  "statusInfo": {
    "reasonCode": "PreviousRequestCanceled",
    "additionalInfo": "이전 요청 ID 12345가 취소되고 새 긴급 요청이 시작됨"
  }
}

예제 5: 특정 시간대 보안 로그 (사건 조사용)

// Request
{
  "logType": "SecurityLog",
  "requestId": 12349,
  "retries": 1,
  "retryInterval": 15,
  "log": {
    "remoteLocation": "https://forensics.csms.com/incident/TKT-2024-0820-001/evidence",
    "oldestTimestamp": "2024-08-20T14:25:00.000Z",
    "latestTimestamp": "2024-08-20T14:35:00.000Z"
  }
}

// Response
{
  "status": "Accepted",
  "filename": "security_incident_20240820_142500-143500.log",
  "statusInfo": {
    "reasonCode": "NoError",
    "additionalInfo": "보안 사건 조사용 로그 수집. 티켓: TKT-2024-0820-001"
  }
}

처리 흐름

  1. 로그 요청: CSMS에서 GetLog 메시지로 로그 수집 요청
  2. 요청 검증:
    • 로그 타입 지원 여부 확인
    • 저장 공간 및 시스템 리소스 확인
    • 이전 요청 상태 확인
  3. 로그 수집:
    • 지정된 기간의 로그 파일 수집
    • 압축 및 패키징
    • 파일명 생성
  4. 업로드 시작: LogStatusNotification으로 진행 상황 보고
  5. 완료 알림: 업로드 완료 또는 실패 시 최종 상태 보고

로그 타입별 특징

SecurityLog (보안 로그)

  • 포함 내용:
    • 인증/인가 이벤트
    • 보안 알람 및 경고
    • 시스템 접근 기록
    • 변조 감지 이벤트
  • 보안 고려사항:
    • 암호화된 전송 필수
    • 무결성 검증
    • 접근 권한 엄격 관리

DiagnosticsLog (진단 로그)

  • 포함 내용:
    • 시스템 성능 지표
    • 오류 및 경고 메시지
    • 네트워크 연결 상태
    • 하드웨어 상태 정보
  • 분석 목적:
    • 성능 최적화
    • 장애 원인 분석
    • 예방 정비 계획

중요 포인트

  • GetLog는 원격 모니터링과 문제 해결의 핵심 도구입니다
  • 로그 수집은 시스템 리소스를 많이 사용하므로 적절한 스케줄링이 필요합니다
  • 보안 로그는 특히 민감한 정보를 포함하므로 암호화와 접근 제어가 필수입니다
  • oldestTimestamplatestTimestamp를 통해 필요한 기간만 선택적으로 수집할 수 있습니다
  • 대용량 로그 파일의 경우 압축을 통해 전송 시간과 비용을 절약해야 합니다
  • 재시도 메커니즘을 통해 네트워크 불안정 상황에서도 안정적인 로그 수집이 가능합니다
  • LogStatusNotification을 통해 실시간으로 진행 상황을 추적할 수 있습니다
  • 로그 수집 정책과 보존 기간을 명확히 설정하여 규정 준수를 보장해야 합니다

이 메시지를 통해 충전소 네트워크의 상태를 원격으로 모니터링하고, 문제 발생 시 신속한 진단과 해결이 가능하며, 보안 감사와 컴플라이언스 요구사항을 충족할 수 있습니다.