public class LogRotator extends BuildDiscarder
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.Modifier and Type | Class and Description |
---|---|
static class |
LogRotator.CollatedLogRotatorException
Deprecated.
Replaced by more generic
CompositeIOException . |
static class |
LogRotator.LRDescriptor |
BuildDiscarder.ConverterImpl
ExtensionPoint.LegacyInstancesAreScopedToHudson
Constructor and Description |
---|
LogRotator(int daysToKeep,
int numToKeep)
Deprecated.
since 1.350.
Use
LogRotator(int, int, int, int) |
LogRotator(int daysToKeep,
int numToKeep,
int artifactDaysToKeep,
int artifactNumToKeep) |
LogRotator(String daysToKeepStr,
String numToKeepStr,
String artifactDaysToKeepStr,
String artifactNumToKeepStr) |
Modifier and Type | Method and Description |
---|---|
int |
getArtifactDaysToKeep() |
String |
getArtifactDaysToKeepStr() |
int |
getArtifactNumToKeep() |
String |
getArtifactNumToKeepStr() |
int |
getDaysToKeep() |
String |
getDaysToKeepStr() |
int |
getNumToKeep() |
String |
getNumToKeepStr() |
static int |
parse(String p) |
void |
perform(Job<?,?> job)
Called to perform "garbage collection" on the job to discard old build records.
|
getDescriptor
@DataBoundConstructor public LogRotator(String daysToKeepStr, String numToKeepStr, String artifactDaysToKeepStr, String artifactNumToKeepStr)
@Deprecated public LogRotator(int daysToKeep, int numToKeep)
LogRotator(int, int, int, int)
public LogRotator(int daysToKeep, int numToKeep, int artifactDaysToKeep, int artifactNumToKeep)
public static int parse(String p)
public void perform(Job<?,?> job) throws IOException, InterruptedException
BuildDiscarder
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, call Run.delete()
.
perform
in class BuildDiscarder
IOException
InterruptedException
Job.logRotate()
public int getDaysToKeep()
public int getNumToKeep()
public int getArtifactDaysToKeep()
public int getArtifactNumToKeep()
public String getDaysToKeepStr()
public String getNumToKeepStr()
public String getArtifactDaysToKeepStr()
public String getArtifactNumToKeepStr()
Copyright © 2004–2022. All rights reserved.