Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-51229

Log Discarder to delete log files generated by Jenkins pipeline scripts, but keep build information

    XMLWordPrintable

Details

    Description

      I've created a log discarder that acts similar to Jenkins' Log Rotation strategy to discard old builds.  However, this log discarder will delete the logs for older builds, but does not delete build information such as when a build was started and how long it took for trend analysis.

       

      I'm willing to submit a pull request!

       

      This change will also mitigate the issue: https://issues.jenkins-ci.org/browse/JENKINS-48344

      Attachments

        Issue Links

          Activity

            oleg_nenashev Oleg Nenashev added a comment -

            BuildDiscatder is an extension point, so it can be implemented in a plugin.
            Also https://github.com/jenkinsci/buildrotator-plugin which may address this use-case

            oleg_nenashev Oleg Nenashev added a comment - BuildDiscatder is an extension point, so it can be implemented in a plugin. Also https://github.com/jenkinsci/buildrotator-plugin which may address this use-case
            adamvoss Adam Voss added a comment -

            The existing, mainstream implementation already includes a distinction between keeping artifacts and keeping the build. Adding another distinction to it about keeping logs seems consistent with the existing role/scope and would provide a generally useful option; especially in the context of JENKINS-48344 or other cases where Jenkins users encounter disk space issues because of log size.

            From that standpoint I'd rather see it in the main implementation than a separate plugin. Would the OP's pull request be considered?

            adamvoss Adam Voss added a comment - The existing, mainstream implementation already includes a distinction between keeping artifacts and keeping the build. Adding another distinction to it about keeping logs seems consistent with the existing role/scope and would provide a generally useful option; especially in the context of JENKINS-48344 or other cases where Jenkins users encounter disk space issues because of log size. From that standpoint I'd rather see it in the main implementation than a separate plugin. Would the OP's pull request be considered?
            oleg_nenashev Oleg Nenashev added a comment -

            Not sure what "OP" means in this case, but we consider all pull requests to the core. Obviously, we expect the changes to be done in a compatible way.

            oleg_nenashev Oleg Nenashev added a comment - Not sure what "OP" means in this case, but we consider all pull requests to the core. Obviously, we expect the changes to be done in a compatible way.
            adamvoss Adam Voss added a comment -

            "Original Poster", I think I might be showing my aged Internet usage... should have used `@` mentions and said thyrex's pull request.

            adamvoss Adam Voss added a comment - "Original Poster", I think I might be showing my aged Internet usage... should have used `@` mentions and said thyrex 's pull request.
            oleg_nenashev Oleg Nenashev added a comment -

            Original pull request from thyrex: https://github.com/jenkinsci/jenkins/pull/3545 

            In https://github.com/jenkinsci/jenkins/pull/3557 I have added Core API, which will allow implementing the Log rotator in a plugin. Once it is in the core, the custom Log rotator could be implemented in https://github.com/jenkinsci/buildrotator-plugin/commits/master or elsewhere (CC jimilian). But TBH I do not fully agree with jglick's comment in the original https://github.com/jenkinsci/jenkins/pull/3545 , IMO this functionality could be an advanced option in the core if done in a compatible way

             

            oleg_nenashev Oleg Nenashev added a comment - Original pull request from thyrex : https://github.com/jenkinsci/jenkins/pull/3545   In https://github.com/jenkinsci/jenkins/pull/3557  I have added Core API, which will allow implementing the Log rotator in a plugin. Once it is in the core, the custom Log rotator could be implemented in https://github.com/jenkinsci/buildrotator-plugin/commits/master  or elsewhere (CC jimilian ). But TBH I do not fully agree with jglick 's comment in the original https://github.com/jenkinsci/jenkins/pull/3545  , IMO this functionality could be an advanced option in the core if done in a compatible way  
            oleg_nenashev Oleg Nenashev added a comment -

            I do not plan to work on it anytime soon, see https://groups.google.com/d/msg/jenkinsci-dev/uc6NsMoCFQI/AIO4WG1UCwAJ for the context. Everybody is welcome to work on it

            oleg_nenashev Oleg Nenashev added a comment - I do not plan to work on it anytime soon, see https://groups.google.com/d/msg/jenkinsci-dev/uc6NsMoCFQI/AIO4WG1UCwAJ for the context. Everybody is welcome to work on it

            People

              Unassigned Unassigned
              thyrex Thy Dai
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: