Classic/VPC 환경에서 이용 가능합니다.
개요
HTTPS 프로토콜로 Effective Log Search & Analytics에 로그를 전송할 수 있으며, 다음과 같은 JSON 형식을 사용합니다.
{
"projectName": "72356c50401b8e20_testproject",
"projectVersion": "1.0.0",
"body": "This log message come from HTTPS client.",
"logLevel": "DEBUG",
"logType": "WEB",
"logSource": "https"
}
파라미터
| 파라미터 | 타입 | 필수 | 설명 |
|---|---|---|---|
projectName |
string |
required |
프로젝트 ID
|
projectVersion |
string |
required |
프로젝트 버전
|
body |
string |
required |
로그 메시지
|
logSource |
string |
optional |
로그 식별값
|
logType |
string |
optional |
로그 식별값
|
주의
- JSON/HTTPS로 로그를 전송할 때는
https://elsa-col.ncloud.com/_store주소를 사용해 주십시오. logTime과sendTime은 시스템에서 사용하는 키입니다. 두 가지 키를 사용 시 Effective Log Search & Analytics에서 무시합니다.- HTTPS 로그 전송은 PUT, POST 메서드만 지원합니다.
로그 전송 예시
curl을 사용하여 정상적으로 로그를 전송한 경우
POST 메서드를 사용하여 로그 전송
$ curl -XPOST 'https://elsa-col.ncloud.com/_store' -d '{
"projectName": "%YOUR_PROJECT_KEY%",
"projectVersion": "1.0.0",
"body": "this log message come from https client, and it is a simple sample.",
"logLevel": "DEBUG",
"logType": "WEB",
"logSource": "https"
}'
PUT 메서드를 사용하여 로그 전송
$ curl -XPUT 'https://elsa-col.ncloud.com/_store' -d '{
"projectName": "%YOUR_PROJECT_KEY%",
"projectVersion": "1.0.0",
"body": "this log message come from https client, and it is a simple sample.",
"logLevel": "DEBUG",
"logType": "WEB",
"logSource": "https"
}'
로그 전송이 실패하는 경우
URL이 잘못된 경우(_store를 _storess로 입력)
$ curl -XPOST 'https://elsa-col.ncloud.com/_storess' -d '{
"projectName": "%YOUR_PROJECT_KEY%",
"projectVersion": "1.0.0",
"body": "this log message come from https client, and it is a simple sample.",
"_xxx": "this is a invalid key"
}'
잘못된 필드 키를 사용한 경우(_xxx)
$ curl -XPOST 'https://elsa-col.ncloud.com/_store' -d '{
"projectName": "%YOUR_PROJECT_KEY%",
"projectVersion": "1.0.0",
"body": "this log message come from https client, and it is a simple sample.",
"_xxx": "this is a invalid key"
}'