ALIYUN::SLS::ServiceLog

ALIYUN::SLS::ServiceLog类型用于激活服务日志。

语法

{
  "Type": "ALIYUN::SLS::ServiceLog",
  "Properties": {
    "ServiceLogTypes": List,
    "ProjectName": String,
    "LogStorageLocation": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

ServiceLogTypes

List

需要激活的服务日志类型。 

取值:

  • DetailedLogs:打开详细日志开关,选择项目后,会在该项目中自动创建日志库和仪表板。 使用Logstore需要付费。

  • ImportantLogs:打开重要日志并选择项目后,该项目中会自动创建一个Logstore,用于存储用户组的消费延迟日志、Logtail心跳日志等日志。 Logstore是免费的。 

  • JobOperationalLogs:在指定的项目中创建一个名为internal-diagnostic_log的日志存储库,用于存储作业操作日志。 记录数据导入作业、定时SQL作业和数据配送作业的操作日志。 Logstore是免费的。 

ProjectName

String

需要激活的项目的名称。  

如果它已经被激活,它将再次被重新激活。

LogStorageLocation

String

服务日志的位置。

返回值

Fn::GetAtt

ProjectName:项目的名称。 

示例

  • YAML格式

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      LogStorageLocation:
        Description:
          en: The location of the service log.
        Required: true
        Type: String
      ProjectName:
        Description:
          en: The name of the project that needs to be activated. If it has been activated,
            it will be reactivated again.
        Required: true
        Type: String
      ServiceLogTypes:
        AssociationProperty: List[Parameter]
        AssociationPropertyMetadata:
          Parameter:
            AllowedValues:
            - DetailedLogs
            - ImportantLogs
            - JobOperationalLogs
            Description:
              en: "Type of service log that needs to be activated. Allowed values: \n\
                DetailedLogs: If you turn on the Detailed Logs switch and select a project,\
                \ a Logstore and a dashboard are automatically created in the project.\
                \ You are charged for using the Logstore.\nImportantLogs: If you turn\
                \ on Important Logs and select a project, a Logstore is automatically\
                \ created in the project to store the logs, such as consumption delay\
                \ logs of consumer groups and Logtail heartbeat logs. The Logstore is\
                \ provided free of charge. \nJobOperationalLogs: A Logstore named internal-diagnostic_log\
                \ is created in the specified project to store job operational logs. The\
                \ operational logs of data import jobs, Scheduled SQL jobs, and data shipping\
                \ jobs are recorded. The Logstore is provided free of charge."
            Required: true
            Type: String
        Description:
          en: 'Types of service log that needs to be activated. '
        MaxLength: 3
        MinLength: 1
        Required: true
        Type: Json
    Resources:
      ServiceLog:
        Properties:
          LogStorageLocation:
            Ref: LogStorageLocation
          ProjectName:
            Ref: ProjectName
          ServiceLogTypes:
            Ref: ServiceLogTypes
        Type: ALIYUN::SLS::ServiceLog
    Outputs:
      ProjectName:
        Description: The name of the project that needs to be activated.
        Value:
          Fn::GetAtt:
          - ServiceLog
          - ProjectName
                            
  • JSON格式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "ServiceLogTypes": {
          "AssociationPropertyMetadata": {
            "Parameter": {
              "Type": "String",
              "Description": {
                "en": "Type of service log that needs to be activated. Allowed values: \nDetailedLogs: If you turn on the Detailed Logs switch and select a project, a Logstore and a dashboard are automatically created in the project. You are charged for using the Logstore.\nImportantLogs: If you turn on Important Logs and select a project, a Logstore is automatically created in the project to store the logs, such as consumption delay logs of consumer groups and Logtail heartbeat logs. The Logstore is provided free of charge. \nJobOperationalLogs: A Logstore named internal-diagnostic_log is created in the specified project to store job operational logs. The operational logs of data import jobs, Scheduled SQL jobs, and data shipping jobs are recorded. The Logstore is provided free of charge."
              },
              "AllowedValues": [
                "DetailedLogs",
                "ImportantLogs",
                "JobOperationalLogs"
              ],
              "Required": true
            }
          },
          "AssociationProperty": "List[Parameter]",
          "Type": "Json",
          "Description": {
            "en": "Types of service log that needs to be activated. "
          },
          "Required": true,
          "MinLength": 1,
          "MaxLength": 3
        },
        "ProjectName": {
          "Type": "String",
          "Description": {
            "en": "The name of the project that needs to be activated. If it has been activated, it will be reactivated again."
          },
          "Required": true
        },
        "LogStorageLocation": {
          "Type": "String",
          "Description": {
            "en": "The location of the service log."
          },
          "Required": true
        }
      },
      "Resources": {
        "ServiceLog": {
          "Type": "ALIYUN::SLS::ServiceLog",
          "Properties": {
            "ServiceLogTypes": {
              "Ref": "ServiceLogTypes"
            },
            "ProjectName": {
              "Ref": "ProjectName"
            },
            "LogStorageLocation": {
              "Ref": "LogStorageLocation"
            }
          }
        }
      },
      "Outputs": {
        "ProjectName": {
          "Description": "The name of the project that needs to be activated.",
          "Value": {
            "Fn::GetAtt": [
              "ServiceLog",
              "ProjectName"
            ]
          }
        }
      }
    }