HTTPS SDKの使用方法
    • PDF

    HTTPS SDKの使用方法

    • PDF

    Article Summary

    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"
    }
    

    パラメータ

    パラメータタイプ必須説明
    projectNamestringrequiredプロジェクト ID。プロジェクト IDを確認する方法は、プロジェクトを照会するを参照します。
    projectVersionstringrequiredプロジェクトバージョン。デフォルト値は1.0.0であり、A~Z、a~z、0~9、ハイフン(-)、句点(.)、アンダースコア(_)のみ使用できます。
    bodystringrequiredログメッセージ。UTF-8を使用し、スペースは使えません。
    logSourcestringoptionalログを識別するために使用し、送信しない場合のデフォルト値は「json」です。
    logTypestringoptionalログを識別するために使用し、送信しない場合のデフォルト値は「nelo2-log」です。

    注意

    JSON/HTTPSで Effective Log Search & Analyticsにログを送信する場合、次のアドレスを使用します。

    https://elsa-col.ncloud.com/_store
    

    "logTime""sendTime"は Effective Log Search & Analyticsのシステムで使用します。2つのキーを使用する場合、Effective Log Search & Analyticsで無視します。

    HTTPSログの送信は PUTと POST方式のみサポートします。

    ログ送信例

    curlを使用して正常にログを送信した場合

    POSTメソッドを使用してログを送信

    $ curl -XPOST 'https://elsa-col.ncloud.com/_store' -d '{
        "projectName": "%YOUR_PROJECT_ID%",
        "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_ID%",
        "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が間違っている場合(_storess -> _store)

    $ curl -XPOST 'https://elsa-col.ncloud.com/_storess' -d '{
        "projectName": "%YOUR_PROJECT_ID%",
        "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_ID%",
        "projectVersion": "1.0.0",
        "body": "this log message come from https client, and it is a simple sample.",
        "_xxx": "this is a invalid key"
        }'
    

    この記事は役に立ちましたか?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.