--- title: "Set server log collection" slug: "analytics-cloudloganalytics-changeserverlogsetting-vpc-server" updated: 2026-09-17T10:05:41Z published: 2026-09-17T10:05:41Z canonical: "api.ncloud-docs.com/analytics-cloudloganalytics-changeserverlogsetting-vpc-server" --- > ## Documentation Index > Fetch the complete documentation index at: https://api.ncloud-docs.com/llms.txt > Use this file to discover all available pages before exploring further. # Set server log collection Available in VPC Set log collection for a server in the VPC environment. After completing the log collection settings, you need to install the log collection agent on the server. Note You can't collect logs through Cloud Log Analytics without installing the log collection agent. See [Install server log collection agent](/docs/en/analytics-cloudloganalytics-changeserverlogsetting-agent) for how to install the log collection agent. ## Request This section describes the request format. The method and URI are as follows: | Method | URI | | --- | --- | | POST | /api/{regionCode}-v1/vpc/servers/collecting-infos | ### Request headers For information about the headers common to all Cloud Log Analytics APIs, see [Cloud Log Analytics request headers](/docs/en/analytics-cloudloganalytics#%EC%9A%94%EC%B2%AD%ED%97%A4%EB%8D%94). ### Request path parameters You can use the following path parameters with your request: | Field | Type | Required | Description | | --- | --- | --- | --- | | `regionCode` | String | Required | Region code - `kr` \| `sgn` \| `jpn` - `kr`: Korea Region - `sgn`: Singapore Region - `jpn`: Japan Region | ### Request body You can include the following data in the body of your request: | Field | Type | Required | Description | | --- | --- | --- | --- | | `collectingInfos` | Array | Required | Set log collection: [collectingInfos](/docs/en/analytics-cloudloganalytics-changeserverlogsetting-vpc-server#collectingInfos) | #### `collectingInfos` The following describes `collectingInfos`. | Field | Type | Required | Description | | --- | --- | --- | --- | | `logPath` | String | Required | Path of log to collect - See the **Management** menu of the Cloud Log Analytics console. - Example: /var/log/messages, /var/log/secure* | | `logTemplate` | String | Required | Template of log to collect - See the **Management** menu of the Cloud Log Analytics console. - Example: APACHE, TOMCAT | | `logType` | String | Required | Type of log to collect - See the **Management** menu of the Cloud Log Analytics console. - Example: SYSLOG, security_log | | `servername` | String | Required | Log collection target server name - See `servername` of [Get server list](/docs/en/analytics-cloudloganalytics-getserverlist-vpc-server), [Get Bare Metal Server list](/docs/en/analytics-cloudloganalytics-getserverlist-vpc-baremetal). | | `osType` | String | Required | Log collection target server operating system - See `osName` of [Get server list](/docs/en/analytics-cloudloganalytics-getserverlist-vpc-server), [Get Bare Metal Server list](/docs/en/analytics-cloudloganalytics-getserverlist-vpc-baremetal). | | `instanceNo` | Integer | Required | Log collection target server instance number - See `instanceNo` of [Get server list](/docs/en/analytics-cloudloganalytics-getserverlist-vpc-server), [Get Bare Metal Server list](/docs/en/analytics-cloudloganalytics-getserverlist-vpc-baremetal). | | `ip` | String | Optional | Log collection target server IP address - See `privateIp` of [Get server list](/docs/en/analytics-cloudloganalytics-getserverlist-vpc-server), [Get Bare Metal Server list](/docs/en/analytics-cloudloganalytics-getserverlist-vpc-baremetal). | | `macAddr` | String | Required | Log collection target server MAC address - See `macAddr` of [Get server list](/docs/en/analytics-cloudloganalytics-getserverlist-vpc-server), [Get Bare Metal Server list](/docs/en/analytics-cloudloganalytics-getserverlist-vpc-baremetal). | ### Request example The request example is as follows: ``` curl --location --request POST 'https://cloudloganalytics.apigw.ntruss.com/api/{regionCode}-v1/vpc/servers/collecting-infos' \ --header 'x-ncp-apigw-timestamp: {Timestamp}' \ --header 'x-ncp-iam-access-key: {Access Key}' \ --header 'x-ncp-apigw-signature-v2: {API Gateway Signature}' \ --header 'Accept: application/json' \ --data '{ "collectingInfos": [ { "logPath": "/var/log/messages", "logTemplate": "SYSLOG", "logType": "SYSLOG", "servername": "s19293c276d5", "osType": "centos-7.3-64", "instanceNo": 27056413, "ip": "***.***.***.***", "macAddr": "**:**:**:**:**:**" } ] }' ``` ## Response This section describes the response format. ### Response body The response body includes the following data: | Field | Type | Required | Description | | --- | --- | --- | --- | | `code` | Integer | - | Response status codes | | `message` | String | - | Response status message | | `result` | Object | - | Response result | | `result.configKey` | String | - | Log collection agent install key | | `result.usage` | String | - | Log collection agent installation command | ### Response status codes For information about the HTTP status codes common to all Cloud Log Analytics APIs, see [Cloud Log Analytics response status codes](/docs/en/analytics-cloudloganalytics#%EC%9D%91%EB%8B%B5%EC%83%81%ED%83%9C%EC%BD%94%EB%93%9C). ### Response example The response example is as follows: ``` { "code": 0, "message": "The request has been successfully processed.", "result": { "configKey": "*********", "usage": "curl -s http://cm.vcla.ncloud.com/setUpClaVPC/********* | sudo sh" } } ```