Todos os produtos
Search
Central de documentação

Resource Orchestration Service:ALIYUN::SLS::ServiceLog

Última atualização: Jun 27, 2026

Ativa o recurso de log de serviço em um projeto do Simple Log Service (SLS).

Sintaxe

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

Propriedades

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrição

ServiceLogTypes

List

Sim

Não

Tipo de log de serviço a ativar.

Valores válidos:

  • DetailedLogs: cria automaticamente um Logstore e um painel no projeto especificado. O uso do Logstore é cobrado.

  • ImportantLogs: cria automaticamente um Logstore no projeto especificado para armazenar logs importantes, como logs de atraso de consumo de grupos de consumidores e logs de heartbeat do Logtail. O uso desse Logstore é gratuito.

  • JobOperationalLogs: cria automaticamente um Logstore chamado internal-diagnostic_log no projeto especificado para registrar logs operacionais de tarefas de importação de dados, tarefas de Scheduled SQL e tarefas de envio de dados. O uso desse Logstore é gratuito.

ProjectName

String

Sim

Não

Nome do projeto no qual ativar o recurso de log de serviço.

Se o recurso de log de serviço já estiver ativado no projeto, especificar o nome do projeto reativa o recurso.

LogStorageLocation

String

Sim

Não

Local de armazenamento dos logs de serviço.

Nenhuma.

Valores de retorno

Fn::GetAtt

ProjectName: nome do projeto.

Exemplos

  • YAML formato

    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 formato

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