Are OSS access logs regularly deleted?

Updated at:
Copy as MD

It depends on where your access logs are stored. Object Storage Service (OSS) does not regularly delete log objects stored in buckets, but Simple Log Service (SLS) does delete logs stored in a Logstore based on the retention period you configure.

Logs stored in a bucket

When you enable logging for a source bucket, OSS writes access logs as objects to a destination bucket. OSS does not regularly delete these log objects — they accumulate indefinitely unless you configure a lifecycle rule to expire them.

Warning

Without a lifecycle rule, log objects persist indefinitely and continue to consume storage, increasing your storage costs. Configure lifecycle rules to automatically delete log objects after a set period. For more information, see Configure lifecycle rules based on the last modified time.

Logs stored in a Logstore

When you enable real-time log query, OSS stores access logs in a Logstore managed by SLS. SLS automatically deletes log data based on the log retention period. By default, Simple Log Service provides a free log retention period of seven days.

If you query the same log data twice and get inconsistent results, SLS may have already deleted some logs because the retention period expired. To keep logs longer, extend the retention period. For more information, see Modify the retention period of logs.