Package hudson.tasks
Class LogRotator
java.lang.Object
hudson.model.AbstractDescribableImpl<BuildDiscarder>
jenkins.model.BuildDiscarder
hudson.tasks.LogRotator
- All Implemented Interfaces:
ExtensionPoint,Describable<BuildDiscarder>
Default implementation of
BuildDiscarder.
For historical reason, this is called LogRotator, but it does not rotate logs :-)
Since 1.350 it has also the option to keep the build, but delete its recorded artifacts.- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDeprecated.static final classNested classes/interfaces inherited from class jenkins.model.BuildDiscarder
BuildDiscarder.ConverterImplNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Constructor Summary
ConstructorsConstructorDescriptionLogRotator(int daysToKeep, int numToKeep) Deprecated.since 1.350.LogRotator(int daysToKeep, int numToKeep, int artifactDaysToKeep, int artifactNumToKeep) LogRotator(String daysToKeepStr, String numToKeepStr, String artifactDaysToKeepStr, String artifactNumToKeepStr) -
Method Summary
Modifier and TypeMethodDescriptionintintintintbooleanstatic intvoidCalled to perform "garbage collection" on the job to discard old build records.voidsetRemoveLastBuild(boolean removeLastBuild) Methods inherited from class jenkins.model.BuildDiscarder
getDescriptor
-
Constructor Details
-
LogRotator
-
LogRotator
Deprecated.since 1.350. UseLogRotator(int, int, int, int) -
LogRotator
public LogRotator(int daysToKeep, int numToKeep, int artifactDaysToKeep, int artifactNumToKeep)
-
-
Method Details
-
parse
-
setRemoveLastBuild
@DataBoundSetter public void setRemoveLastBuild(boolean removeLastBuild) -
perform
Description copied from class:BuildDiscarderCalled to perform "garbage collection" on the job to discard old build records.Normally invoked automatically jobs when new builds occur. The general expectation is that those marked as
Run.isKeepLog()will be kept untouched. To delete the build record, callRun.delete().- Specified by:
performin classBuildDiscarder- Throws:
IOExceptionInterruptedException- See Also:
-
getDaysToKeep
public int getDaysToKeep() -
getNumToKeep
public int getNumToKeep() -
getArtifactDaysToKeep
public int getArtifactDaysToKeep() -
getArtifactNumToKeep
public int getArtifactNumToKeep() -
isRemoveLastBuild
public boolean isRemoveLastBuild() -
getDaysToKeepStr
-
getNumToKeepStr
-
getArtifactDaysToKeepStr
-
getArtifactNumToKeepStr
-
CompositeIOException.