Nothing Special   »   [go: up one dir, main page]

Skip to content
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

feat: gradle property to change daemon log level #31347

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

davidgiga1993
Copy link
@davidgiga1993 davidgiga1993 commented Nov 19, 2024

Fixes #26474 and #2688

Context

Handling the daemon logs is a long standing open issue which caused many issues over time as:

  • Log files were too verbose as there was no way to change the daemon log level
  • Log files never got cleaned up

This changeset introduces the following:

  • A new property called org.gradle.daemon.log.level which defines the log level of the daemon. The default is set to debug (this is the current default - should we also change the default to info in this mr?)
  • Code to automatically delete log files older than 2 weeks - This duration is arbitrary but better than no cleanup at all. Not sure if this should be configurable as well? I would like to keep this MR rather small to get it ready for production quicker.

Contributor Checklist

  • Review Contribution Guidelines.
  • Make sure that all commits are signed off to indicate that you agree to the terms of Developer Certificate of Origin.
  • Make sure all contributed code can be distributed under the terms of the Apache License 2.0, e.g. the code was written by yourself or the original code is licensed under a license compatible to Apache License 2.0.
  • Check "Allow edit from maintainers" option in pull request so that additional changes can be pushed by Gradle team.
  • Provide integration tests (under <subproject>/src/integTest) to verify changes from a user perspective.
  • Provide unit tests (under <subproject>/src/test) to verify logic.
  • Update User Guide, DSL Reference, and Javadoc for public-facing changes.
  • Ensure that tests pass sanity check: ./gradlew sanityCheck.
  • Ensure that tests pass locally: ./gradlew <changed-subproject>:quickTest.

Reviewing cheatsheet

Before merging the PR, comments starting with

  • ❌ ❓must be fixed
  • 🤔 💅 should be fixed
  • 💭 may be fixed
  • 🎉 celebrate happy things

feat: auto-cleanup of old daemon log files
Signed-off-by: david <davidgiga1993@gmail.com>
@davidgiga1993 davidgiga1993 requested a review from a team as a code owner November 19, 2024 16:00
@bot-gradle bot-gradle added from:contributor PR by an external contributor to-triage labels Nov 19, 2024
@ljacomet
Copy link
Member

Thank you for your contribution!

This PR has a valid DCO and tests. The relevant team for this area will confirm the design of the implementation choices.


Regarding the log file cleanup, you may want to take a look at regular cache cleanup feature of Gradle. I believe that daemon log clean up should be based on the "created" resource time and also better be done when the daemon exits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
from:contributor PR by an external contributor in:daemon in:logging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow changing the daemon log level
3 participants