A project is the fundamental resource management unit in Simple Log Service (SLS), used for resource isolation and access control.
Background
A project can contain resources such as logstores, metricstores, and machine groups, and serves as the entry point for accessing SLS resources. We recommend that you use different projects to manage data from different applications, products, or environments for the following reasons:
Organize and manage different logstores or metricstores: Use projects to classify and manage logs from different applications, products, or environments. This simplifies data consumption, export, and analysis tasks.
Isolate access control: Grant Resource Access Management (RAM) users permissions to perform operations on specific projects.
Project-specific endpoints: Each project has a unique endpoint, which serves as the network entry point for writing, reading, and managing its resources. For more information about endpoints, see Service endpoints.
Create a project
You can create a project to manage all logs and related log sources for an application.
Console
Log on to the Simple Log Service console, navigate to the Projects section, and click Create Project.
Configure the project.
Region: Select an Alibaba Cloud region based on the location of your log sources and other factors. After a project is created, its region cannot be changed. SLS does not support cross-region project migration. If you want to collect logs from ECS instances, select the same region as the ECS instances. This lets you collect logs over the Alibaba Cloud internal network and accelerates log collection.
Project Name: The name of the project. The name must be globally unique within Alibaba Cloud. After a project is created, its name cannot be changed.
Leave the other parameters at their default values.
API
Enable project deletion protection
Enable the recycle bin feature for projects that contain important data to prevent accidental deletion. When this feature is enabled, deleted projects are moved to the recycle bin. Projects in the recycle bin are inactive and do not support read or write operations. If you later decide that a deleted project is still required, quickly restore it from the recycle bin. You are charged only for the data storage of projects in the recycle bin.
A project is retained in the recycle bin for 7 days by default and is automatically deleted after the retention period ends.
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.
In the Basic Information section of the Project Overview page, enable Recycle Bin.
API
Modify the recycleBinEnabled parameter in the UpdateProject operation.
Delete and restore project resources
When you delete a project, the data in its logstores is permanently deleted. Before deleting a project, ensure that the data in resources such as logstores, metricstores, and eventstores is no longer needed or has been backed up.
You are charged for storage and other resources on the day that you delete a project. For more information about how to stop billing, see How do I disable SLS and stop billing?. Billing for SLS stops on the third day after you delete the project.
Console
Clear resources before deletion
No service linkages:
When you enable the log analysis feature for Alibaba Cloud services such as elastic computing, storage, security, and databases, a corresponding project and logstore are automatically created in the SLS console. If you no longer need the logs from an Alibaba Cloud service, you must disable the log analysis feature for that service in the console of that service. Ensure that the project is not associated with other Alibaba Cloud 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, you must first export the data using the Download logs feature.
Back up configuration information: Record key configurations, such as the project name, storage capacity, and access control settings, to prevent information loss after deletion.
Delete the project
In the project list, find the project you want to delete and click Delete in the Actions column.
In the Delete Project dialog box, enter the project name, select a reason for deletion, and click OK.
WarningAfter a project is deleted, all log data and configuration information in the project are deleted and cannot be restored. Proceed with caution to prevent data loss.
If the recycle bin feature is enabled for a project, find the 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 which you can restore or permanently delete it.
API
Manage resource quotas
If your resource quotas are insufficient, request an increase in the quotas for various project metrics, such as the maximum number of logstores, shards, Logtail configurations, and machine groups.
You can create a maximum of 150 projects under an Alibaba Cloud account. To require a higher quota, submit a ticket to request an increase.
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 to submit the application. The modification will take effect in about one hour.
Accelerate cross-region log transfer
For long-distance log transfers, such as from a region outside the Chinese mainland to one within, enable the transfer acceleration feature. This feature leverages a global network of data centers and intelligent routing to direct requests to the nearest SLS access point, significantly improving transfer speeds through optimized network paths and protocols. You are charged for transfer acceleration 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.
In the Endpoint section of the Project Overview page, find Acceleration Endpoint and click Enable. Read the message in the dialog box and click Modify.
After you enable transfer acceleration, the transmission speed is improved when you use Logtail to collect logs or execute data transformation jobs.
API
First, call the PutProjectTransferAcceleration operation.
To use this feature, you must set the
endpointparameter to an acceleration endpoint. Acceleration endpoints support API access only over HTTP and HTTPS. They do not support other protocols, such as Kafka or gRPC. In scenarios where transfer acceleration is not required, we recommend that you use service endpoints to reduce transmission 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
To group projects, you can use tags or resource groups. The main difference is the scope of grouping. Tags are used for grouping and management at the project level. Resource groups provide a mechanism for managing resources at the Alibaba Cloud 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, 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, 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 domain name. After you configure a custom domain name, you can use it as the endpoint in API calls.
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 current project.
In the Basic Information section of the Project Overview page, hover over Custom Domain and click Modify. In the Specify Custom Endpoint panel, enter the domain name and click Bind. For more information, see Register a domain name.
In the Alibaba Cloud DNS console, create a CNAME record to point your custom domain to the public endpoint. Set Record Value to the Public Endpoint recorded in the SLS Project Overview page. For more information, see CNAME record.
API
Monitor project resources
Use the service log feature to obtain various types of logs, including operation logs for actions like creating, modifying, updating, and deleting. It also provides task execution logs for jobs such as scheduled SQL, data import, and data shipping, as well as consumption latency logs for consumer groups in a logstore 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 Service Log page of 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 let SLS automatically create a new one to store these logs.
More information
To store different types of data in a project, you must create different types of stores. For more information, see Manage stores.