New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gradle logging hygiene #2688
Comments
I just found 20 Gb worth of deamon logs in ~/.gradle. Some of these were 4Gb full of System.out output some debug task I ran some month ago. |
I just removed 89Gb of text files in |
I just deleted 160GB after Android studio complained I didn't have enough disk space - 1 day later and log files are at 2.4GB - this is insane . (I also have over 9GB of memory used from AS, but that's another issue :D) |
+1 |
+1 I deleted 100+GB. This is a big issue. Gradle shouldn't log anything to a separate file unless it is specifically configured to do so. |
It looks like the log level in these files is |
It looks like it's hardcoded in DaemonMain.java#L192, probably providing a |
org.gradle.logging.level=(quiet,warn,lifecycle,info,debug) |
+1 |
Any progress on this? This fills my hard drive and blocks work without warning until I investigate and fix each time. Would have considered this a major issue due to it impacting the entire user's system as a side effect. |
The problem is that none of the log levels is able to render nothing. I don't want to have to clean by hand my production VM every now an then :/ |
It would be great if there was some "good default" like "delete older than a month". "Do not eat up the whole disk by default" |
+1 |
2 similar comments
+1 |
+1 |
+1 - jesus this is insane and I can't believe it's still going. |
Any updates on this? I just deleted several GB of not just logs, but also some so-called "temporary" files Gradle never cleaned up.. |
+1 |
This doesn't have to be automatic, just a command like |
Not everybody use docker, OK can be any such command, but better be safe than sorry with an automated option. OK could be a any such command runs by a cron job. But sincerely it would much more easy with an embedded documented function for that rather than being surprised one day with a disk full! |
We just deleted 60+GB on our CI agents after figuring this out, multiple hundreds of GB in total space. We don't use docker, so we have to setup a cleanup job I guess. An easy build-in option to prune logs is highly appreciated. I don't think many people outside of the Gradle team even look at those logs. |
Default tasks for cleaning the logs and cache would be very nice. |
If this is going to be fixed - please also have a look in the "/tmp" directory for the kotlin-daemon log files (kotlin daemon is spawned by gradle if kotlin is used e.g. in buildSrc), those are gathering there too: /tmp/kotlin-daemon.2022-07-11.10-04-03-480.00.log and so one for each daemon and each day - on CI this is gathering up fast. |
15GB of logs here... All I can say is wtf? No production code should have this type of log issue today, and when opened up how many years ago? To still be a problem? |
it's fully ridiculous that this isn't fixed. just found out this was taking up 20% of my SSD. ideal would be providing a default that makes any sense. in lieu of that, please at least make this configurable. |
We just ran across this same issue, a month into building, on our CI server we had 40G of logs in this directory, almost a terabyte across the CI landscape… |
Why is this so hard to fix? This issue has been open for for over 5 years already and I don't even see any response from the Gradle team. |
Thank you for your interest in Gradle! This feature request is in the backlog of the relevant team and is prioritized by them. |
Good news, thanks @jbartok :) |
this bug just killed my build server... rule #1 of ever writing code using a temp dir is the owning app must clean itself up...if it doesn't, then it's broken. i'm shocked to see that it's been so many years, going back many gradle versions, and this has still been an issue...but at least it's getting attention now in my case, it is until then, looks like we're going to have to write a cleanup job hack for this 1 application so it doesn't break the build server for everyone every month |
please Request repair, I am especially afraid that the computer will break down |
My builds have been having strange performance issues lately. And after a deep dive with a profiler, I finally found out it was because of this. The Gradle daemon logger is creating 1GB logs for some of my larger builds. I have hundreds of subprojects, and gradle doesn't seem to account for this level scaling with its daemon logger. Some of my builds, the daemon logger is the primary consumer of CPU. Also, I just deleted 137 GB of logs. Good thing I caught this before I filled up my hard drive, which can be a huge risk. I once almost lost all my files on a computer where I accidentally filled up the hard drive to max. I request the following:
|
Is there any way to configure the daemon log level currently? Any workaround? |
In just a single simple build where I run one task (a no-op task that does nothing), I produce a daemon log file with hundreds of thousands of lines like this:
|
Implement log hygiene in Gradle's default configuration, as described in:
https://discuss.gradle.org/t/gradle-daemon-produces-a-lot-of-logs/9905
Expected Behavior
Gradle should be configured out-of-the-box with a rolling file appender or similar mechanism so that the daemon logs are periodically cleaned up.
Current Behavior
Gradle produces daemon logs in a hidden user directory. These logs accumulate over time and are never cleaned up.
Context
My Grails build was leaking daemon processes, contributing to low disk space on C:
(The daemon process leak is beyond the scope of this feature request.)
Steps to Reproduce (for bugs)
Not a bug.
Your Environment
Win7 x64, Grails 3.3.0, Gradle 3.4.1, Groovy 2.4.7, JVM 1.8.0_66
The text was updated successfully, but these errors were encountered: