All Products
Search
Document Center

Simple Log Service:How do I delete logs?

Last Updated:Nov 14, 2025

Simple Log Service (SLS) does not support direct deletion of logs. Instead, log removal is managed by setting a data retention period for your logstore. Once a log's age exceeds this period, it is automatically deleted. This topic explains how to configure the data retention period.

Procedure

  1. Log on to the Simple Log Service console.

  2. In the Projects section, click the project that you want to manage.

    image

  3. On the Log Storage > Logstores tab, move the pointer over your logstore and choose 修改日志库 > Modify.

    image

  4. On the Logstore Attributes page, click Modify.

    image

  5. Modify the Data Retention Period parameter and click Save.

    When the retention period of a log reaches the specified data retention period of the logstore, the log is deleted.

    Important
    • If you shorten the data retention period, SLS deletes all expired data within 1 hour. For example, if you change the data retention period from 5 days to 1 day, SLS deletes the logs of the previous four days within 1 hour.

    • Logs cannot be restored after being deleted. Proceed with caution.

References

For issues like not being able to delete projects, lost logs, and reducing log storage costs, see Manage a logstore.