# Where can I find the log files for scheduled cache cleanup

**URL:** <https://discuss.gradle.org/t/where-can-i-find-the-log-files-for-scheduled-cache-cleanup/51608>\
**Category:** Help/Discuss\
**Created:** [September 23, 2025, 9:15am UTC](https://discuss.gradle.org/t/where-can-i-find-the-log-files-for-scheduled-cache-cleanup/51608 "2025-09-23T09:15:45Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![pidanxiangjiao](https://avatars.discourse-cdn.com/v4/letter/p/a5b964/32.png) [@pidanxiangjiao](https://discuss.gradle.org/u/pidanxiangjiao)\
**Post date:** [September 23, 2025, 9:15am UTC](https://discuss.gradle.org/t/where-can-i-find-the-log-files-for-scheduled-cache-cleanup/51608/1 "2025-09-23T09:15:45Z")

</div>

I have set the following options to regularly clear Gradle cache disk usage:

```gradle
beforeSettings { 
     settings → settings.caches {
         createdResources.removeUnusedEntriesAfterDays = 1
         buildCache.removeUnusedEntriesAfterDays = 1
     }
}

```

Gradle Version: 8.9

May I ask where I can see the execution logs for this policy?

---

<div class="post-metadata">

**Author:** ![Vampire](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/vampire/32/9082_2.png) [@Vampire](https://discuss.gradle.org/u/Vampire)\
**Post date:** [September 23, 2025, 9:19am UTC](https://discuss.gradle.org/t/where-can-i-find-the-log-files-for-scheduled-cache-cleanup/51608/2 "2025-09-23T09:19:03Z")

</div>

In `<GRADLE_USER_HOME>/daemon/8.9/daemon-*.out.log`.

---

<div class="post-metadata">

**Author:** ![pidanxiangjiao](https://avatars.discourse-cdn.com/v4/letter/p/a5b964/32.png) [@pidanxiangjiao](https://discuss.gradle.org/u/pidanxiangjiao)\
**Post date:** [September 23, 2025, 9:27am UTC](https://discuss.gradle.org/t/where-can-i-find-the-log-files-for-scheduled-cache-cleanup/51608/3 "2025-09-23T09:27:03Z")

</div>

**Are there any specific tags or keywords that can be used to locate the relevant log entries?**

---

<div class="post-metadata">

**Author:** ![Vampire](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/vampire/32/9082_2.png) [@Vampire](https://discuss.gradle.org/u/Vampire)\
**Post date:** [September 23, 2025, 9:27am UTC](https://discuss.gradle.org/t/where-can-i-find-the-log-files-for-scheduled-cache-cleanup/51608/4 "2025-09-23T09:27:41Z")

</div>

“cleanup” case insensitively?

---

<div class="post-metadata">

**Author:** ![Vampire](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/vampire/32/9082_2.png) [@Vampire](https://discuss.gradle.org/u/Vampire)\
**Post date:** [September 23, 2025, 9:30am UTC](https://discuss.gradle.org/t/where-can-i-find-the-log-files-for-scheduled-cache-cleanup/51608/5 "2025-09-23T09:30:09Z")

</div>

Or look for the lines after the line that starts with `BUILD` which is either `BUILD FAILED` or `BUILD SUCCESSFUL`. The cleanup happens after the actual build was finished.

---

<div class="post-metadata">

**Author:** ![pidanxiangjiao](https://avatars.discourse-cdn.com/v4/letter/p/a5b964/32.png) [@pidanxiangjiao](https://discuss.gradle.org/u/pidanxiangjiao)\
**Post date:** [September 23, 2025, 9:31am UTC](https://discuss.gradle.org/t/where-can-i-find-the-log-files-for-scheduled-cache-cleanup/51608/6 "2025-09-23T09:31:57Z")

</div>

**We are performing builds on a CI server, and the build command specifies the** `--no-daemon` **parameter.**

---

<div class="post-metadata">

**Author:** ![Vampire](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/vampire/32/9082_2.png) [@Vampire](https://discuss.gradle.org/u/Vampire)\
**Post date:** [September 23, 2025, 9:51am UTC](https://discuss.gradle.org/t/where-can-i-find-the-log-files-for-scheduled-cache-cleanup/51608/7 "2025-09-23T09:51:56Z")

</div>

Doesn’t matter.  
Nowadays `--no-daemon` usually means "use a one-off daemon that is only used for this build and then discarded.  
So it really is `--no-daemon-reuse` most times.  
To really have no daemon you would need to ensure the CLI process can serve as daemon process which would include setting the necessary heap options and also the Gradle instrumentation agent for the current Gradle version.

---

<div class="post-metadata">

**Author:** ![pidanxiangjiao](https://avatars.discourse-cdn.com/v4/letter/p/a5b964/32.png) [@pidanxiangjiao](https://discuss.gradle.org/u/pidanxiangjiao)\
**Post date:** [September 24, 2025, 9:15am UTC](https://discuss.gradle.org/t/where-can-i-find-the-log-files-for-scheduled-cache-cleanup/51608/8 "2025-09-24T09:15:32Z")

</div>

```gradle
51179944 /.gradle/caches/build-cache-1
54743404 /.gradle/caches/8.9

```

```gradle
4 /.gradle/caches/8.9/generated-gradle-jars
8 /.gradle/caches/8.9/file-changes
8 /.gradle/caches/8.9/md-rule
8 /.gradle/caches/8.9/md-supplier
20 /.gradle/caches/8.9/fileContent
85768 /.gradle/caches/8.9/fileHashes
181316 /.gradle/caches/8.9/groovy-dsl
1266880 /.gradle/caches/8.9/javaCompile
53209388 /.gradle/caches/8.9/transforms
54743404 /.gradle/caches/8.9

```

Our disk usage has reached 100G, and it seems that the configured strategy has not taken effect.

---

<div class="post-metadata">

**Author:** ![pidanxiangjiao](https://avatars.discourse-cdn.com/v4/letter/p/a5b964/32.png) [@pidanxiangjiao](https://discuss.gradle.org/u/pidanxiangjiao)\
**Post date:** [September 24, 2025, 9:18am UTC](https://discuss.gradle.org/t/where-can-i-find-the-log-files-for-scheduled-cache-cleanup/51608/9 "2025-09-24T09:18:02Z")

</div>

Build cache: The local build cache (e.g., build-cache-1).  
The default retention period for unused build-cache entries is 7 days.

Can this be configured to automatically clear after 1 day? Which configuration option should be used?

current i set buildCache.removeUnusedEntriesAfterDays = 1

---

<div class="post-metadata">

**Author:** ![Vampire](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/vampire/32/9082_2.png) [@Vampire](https://discuss.gradle.org/u/Vampire)\
**Post date:** [September 24, 2025, 10:06am UTC](https://discuss.gradle.org/t/where-can-i-find-the-log-files-for-scheduled-cache-cleanup/51608/10 "2025-09-24T10:06:54Z")

</div>

Sounds correct to me.  
If it does not work in your setup, you should maybe report a bug. 🤷‍♂️

---

<div class="post-metadata">

**Author:** ![pidanxiangjiao](https://avatars.discourse-cdn.com/v4/letter/p/a5b964/32.png) [@pidanxiangjiao](https://discuss.gradle.org/u/pidanxiangjiao)\
**Post date:** [September 25, 2025, 2:09am UTC](https://discuss.gradle.org/t/where-can-i-find-the-log-files-for-scheduled-cache-cleanup/51608/11 "2025-09-25T02:09:22Z")

</div>

![image](https://global.discourse-cdn.com/gradle/original/2X/0/0df430fd0d4c96c8f30cb4416106889f55b4056a.png)

Does this configuration require the number of days to be greater than 1? `buildCache.removeUnusedEntriesAfterDays = 1`

---

<div class="post-metadata">

**Author:** ![Vampire](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/vampire/32/9082_2.png) [@Vampire](https://discuss.gradle.org/u/Vampire)\
**Post date:** [September 25, 2025, 9:06am UTC](https://discuss.gradle.org/t/where-can-i-find-the-log-files-for-scheduled-cache-cleanup/51608/12 "2025-09-25T09:06:23Z")

</div>

I have no idea, never used it.  
If so, that’s a documentation bug and maybe also the call should fail.  
The API you use does not specify that limitation. 🤷‍♂️

---

<div class="post-metadata">

**Author:** ![Vampire](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/vampire/32/9082_2.png) [@Vampire](https://discuss.gradle.org/u/Vampire)\
**Post date:** [September 25, 2025, 9:15am UTC](https://discuss.gradle.org/t/where-can-i-find-the-log-files-for-scheduled-cache-cleanup/51608/13 "2025-09-25T09:15:22Z")

</div>

Also, there is a test that you cannot set to \<1: [gradle/subprojects/core/src/test/groovy/org/gradle/api/internal/cache/DefaultCacheConfigurationsTest.groovy at master · gradle/gradle · GitHub](https://github.com/gradle/gradle/blob/master/subprojects/core/src/test/groovy/org/gradle/api/internal/cache/DefaultCacheConfigurationsTest.groovy#L238-L242)

But no test that 1 does not work, so I would expect it to work.

And looking at [gradle/subprojects/core-api/src/main/java/org/gradle/caching/local/DirectoryBuildCache.java at v8.14.3 · gradle/gradle · GitHub](https://github.com/gradle/gradle/blob/v8.14.3/subprojects/core-api/src/main/java/org/gradle/caching/local/DirectoryBuildCache.java#L74-L76) I’d say even in the old API 1 was ok but the JavaDoc was wrong.
