A project in Simple Log Service (SLS) is the basic unit for resource management, providing resource isolation, access control, and an entry point to SLS resources.
What is a project?
A project provides resource isolation and access control in SLS.
A project contains Logstores, MetricStores, machine groups, and other resources. Use separate projects to manage data from different applications, products, or environments:
-
Organize and manage different Logstores or MetricStores: Separate logs by application, product, or environment into different projects for easier consumption, export, and analysis.
-
Isolate access control: Grant RAM users permissions on specific projects.
-
Provide an entry point to SLS resources: Each project has a dedicated endpoint for writing, reading, and managing logs over the network. Service endpoints.
Create a project
Create a project to manage logs and log sources for an application.
Console
-
Log on to the Simple Log Service console. In the Projects section, click Create Project.
-
Configure the project:
-
Region: Select a region based on your log source location. The region cannot be changed after creation. To collect ECS logs over the internal network, select the same region as the ECS instances.
-
Project name: Must be globally unique within Alibaba Cloud. Cannot be changed after creation.
-
Leave the other parameters at their default values.
-
API
Identify the project source
SLS may automatically create projects when associated with other Alibaba Cloud services. Trace a project's source to identify its origin, stored data, and costs.
-
Log on to the Simple Log Service console. In the Projects section, find the target project.
-
Check for an icon next to the project name or review the Description column to identify the project's source:
-
If an icon appears before the project name, hover over the icon. The name of the associated cloud service is displayed.
-
The Description column specifies the source of the project.
-
If neither of these conditions is met, the project was created manually.
-
-
After identifying the associated cloud service, check Collection of Alibaba Cloud service logs for details on stored data.
If the associated cloud service is still in use, do not delete the automatically created project.
-
Use CloudLens for SLS to analyze resource usage and estimate costs.
Enable project deletion protection
Enable the recycle bin to protect important projects from accidental deletion. Deleted projects move to the recycle bin, where they are inactive with no read or write access. You can restore a recycled project at any time. Only data storage fees apply to recycled projects.
Projects are retained in the recycle bin for 7 days by default and automatically deleted afterward.
Console
Enable the recycle bin feature
-
Log on to the Simple Log Service console. In the Projects section, click the name of the target project.
-
On the Project Overview page, in the Basic Information section, locate the Recycle Bin and click Enable if it is disabled.
API
Modify the recycleBinEnabled parameter in the UpdateProject operation.
Delete and restore project resources
Deleting a project permanently removes all data in its Logstores, MetricStores, and EventStores. Ensure the data is no longer needed or has been backed up before proceeding.
Storage and other fees are still incurred on the day you delete a Project, and billing stops on the following day. This means that you will no longer receive a bill for Simple Log Service starting from the third day after you delete the Project.
Console
-
Clear resources before deletion
-
No associated resources:
-
When you enable log analysis for Alibaba Cloud services (elastic computing, storage, security, databases, etc.), SLS automatically creates a corresponding project and Logstore. To remove these logs, disable log analysis in the respective service console. Verify that the project is not associated with other services.
-
-
No billing dependencies: Ensure any associated paid resources, such as storage plans or provisioned capacity, are released or unsubscribed from.
-
-
Steps to delete a project
-
Back up important data (optional)
-
Back up Logstore data: If the project contains log data that you need to retain, export the data first using the Download logs feature.
-
Back up configuration information: Record key configurations such as the project name, storage capacity, and access control settings.
-
-
Delete the project
-
In the project list, find the project to delete and click Delete.
-
In the Delete Project dialog box, enter the project name, select a reason, and click OK.
WarningAll log data and configuration in the project are permanently deleted and cannot be restored. Proceed with caution.
-
Confirm by entering the project name when prompted.
-
-
-
If the recycle bin feature is enabled for a project, you can find a deleted project on the Recycle Bin Projects tab in the project list. By default, a project is retained in the recycle bin for 7 days. During this period, you can restore or permanently delete it.
API
Manage resource quotas
Adjust quotas for project-level resources such as Logstores, shards, Logtail configurations, and machine groups.
You can create a maximum of 150 projects under an Alibaba Cloud account. To request a higher quota, submit a ticket.
Console
-
Log on to the Simple Log Service console. In the Projects section, click the name of the target project.
-
In the Basic Information section of the Project Overview page, find Resource Quotas and click Manage. In the Resource Quotas panel, adjust the quota for the desired resource and click Save. The change takes effect in about one hour.
Accelerate cross-region log transfer
Enable transfer acceleration for long-distance log transfers, such as from regions outside the Chinese mainland to regions inside. Transfer acceleration routes requests to the nearest SLS access point through a global network with optimized paths and protocols. You are charged based on the amount of data transferred.
Console
Enable transfer acceleration
-
Log on to the Simple Log Service console. In the Projects section, click the name of the target project.
-
On the Project Overview page, in the Endpoint section, locate the Acceleration Endpoint and click Enable. Read the message in the dialog box and click Modify.
-
Transfer acceleration improves speeds for Logtail log collection and data transformation jobs.
API
-
Set the
endpointparameter to an acceleration endpoint. Acceleration endpoints support only HTTP and HTTPS, not Kafka or gRPC. When acceleration is not needed, use standard endpoints to reduce costs./** * This example obtains the AccessKey ID and AccessKey secret from environment variables. */String accessId = System.getenv("ALIBABA_CLOUD_ACCESS_KEY_ID"); String accessKey = System.getenv("ALIBABA_CLOUD_ACCESS_KEY_SECRET"); /** * The service endpoint of SLS. Use an acceleration endpoint. */String endpoint = "log-global.aliyuncs.com"; /** * Create an SLS client. */static Client client = new Client(host, accessId, accessKey);
Manage resource groups
Group projects using tags (project-level) or resource groups (account-level).
Set resource groups
A project can belong to only one resource group.
Console
-
Log on to the Simple Log Service console. In the Projects section, click the name of the target project.
-
In the Resource Group Details section of the Project Overview page, hover over the resource group ID, click Modify, and then select a new resource group.
API
Set tags
Console
-
Log on to the Simple Log Service console. In the Projects section, click the name of the target project.
-
In the Tag section of the Project Overview page, click Edit, and then configure the tags.
API
View domain names and configure a custom domain name
View domain name information or replace a public domain name with a custom one for use as the API endpoint.
Console
-
Log on to the Simple Log Service console. In the Projects section, click the name of the target project.
-
In the Endpoint section of the Project Overview page, view the domain information for the project.
-
Hover your mouse over Specify Custom Endpoint > Specify Custom Endpoint > Specify Custom Endpoint, then click Specify Custom Endpoint. In the Specify Custom Endpoint panel, click Bind. Register a domain name.
-
In the Alibaba Cloud DNS console, create a CNAME record to bind your domain. Set Record Value to the Public Endpoint on the Project Overview page under Basic Information > Endpoint. CNAME record.
API
Monitor project resources
Use the service log feature to collect operation logs for resource changes, task execution logs for scheduled SQL, data import, and data shipping jobs, consumption latency logs for consumer groups, and error, heartbeat, and statistics logs for Logtail.
Console
-
Log on to the Simple Log Service console. In the Projects section, click the name of the target project.
-
On the Enable Detailed Logs page for the project, click Enable Detailed Logs. In the Modify Service Log Settings panel, select the service logs to enable and the target project.
-
Detailed logs: Provides complete operation logs. This is a pay-as-you-go feature.
-
Important logs: Provides metering logs, consumer group latency logs, and Logtail heartbeat logs. This feature is free of charge.
-
Job operational logs: Provides the execution logs of data import, scheduled SQL, and data shipping jobs. This feature is free of charge.
-
Log storage location: Choose an existing project or allow SLS to automatically create a new one to store these logs.
-
What's next
To store different types of data in a project, create different types of stores. Manage stores.