public class CrawlerLoggerModule extends Object implements UriErrorLoggerModule, org.springframework.context.Lifecycle, org.springframework.beans.factory.InitializingBean, Checkpointable, SimpleFileLoggerProvider, org.springframework.beans.factory.DisposableBean
Modifier and Type | Field and Description |
---|---|
protected ConfigPath |
alertsLogPath |
protected ConfigPath |
crawlLogPath |
protected boolean |
isRunning |
protected boolean |
logExtraInfo
Whether to include the "extra info" field for each entry in crawl.log.
|
static char |
MANIFEST_CONFIG_FILE
abbreviation label for config files in manifest
|
static char |
MANIFEST_LOG_FILE
abbreviation label for log files in manifest
|
static char |
MANIFEST_REPORT_FILE
abbreviation label for report files in manifest
|
protected ConfigPath |
nonfatalErrorsLogPath |
protected ConfigPath |
path |
protected ConfigPath |
progressLogPath |
protected Checkpoint |
recoveryCheckpoint |
protected ConfigPath |
runtimeErrorsLogPath |
protected ConfigPath |
uriErrorsLogPath |
Constructor and Description |
---|
CrawlerLoggerModule() |
Modifier and Type | Method and Description |
---|---|
void |
addToManifest(String file,
char type,
boolean bundle)
Add a file to the manifest of files used/generated by the current
crawl.
|
void |
afterPropertiesSet() |
void |
closeLogFiles()
Close all log files and remove handlers from loggers.
|
void |
destroy() |
void |
doCheckpoint(Checkpoint checkpointInProgress)
Run checkpointing.
|
void |
finishCheckpoint(Checkpoint checkpointInProgress)
Cleanup/unlock; need not complete for a checkpoint to be valid.
|
int |
getAlertCount() |
ConfigPath |
getAlertsLogPath() |
ConfigPath |
getCrawlLogPath() |
boolean |
getLogExtraInfo() |
Logger |
getNonfatalErrors() |
ConfigPath |
getNonfatalErrorsLogPath() |
ConfigPath |
getPath() |
ConfigPath |
getProgressLogPath() |
Logger |
getProgressStats() |
Logger |
getRuntimeErrors() |
ConfigPath |
getRuntimeErrorsLogPath() |
Logger |
getUriErrors() |
ConfigPath |
getUriErrorsLogPath() |
Logger |
getUriProcessing() |
boolean |
isRunning() |
void |
logUriError(org.apache.commons.httpclient.URIException e,
UURI u,
CharSequence l)
Log a URIException from deep inside other components to the crawl's
shared log.
|
void |
resetAlertCount() |
void |
rotateLogFiles() |
protected void |
rotateLogFiles(String generationSuffix) |
protected void |
rotateLogFiles(String generationSuffix,
boolean mergeOld) |
void |
setAlertsLogPath(ConfigPath cp) |
void |
setCrawlLogPath(ConfigPath cp) |
void |
setLogExtraInfo(boolean logExtraInfo) |
void |
setNonfatalErrorsLogPath(ConfigPath cp) |
void |
setPath(ConfigPath cp) |
void |
setProgressLogPath(ConfigPath cp) |
void |
setRecoveryCheckpoint(Checkpoint checkpoint)
Used to inform a bean that it should restore its state from
the given Checkpoint when launched (Lifecycle start()).
|
void |
setRuntimeErrorsLogPath(ConfigPath cp) |
protected void |
setupLogs() |
Logger |
setupSimpleLog(String logName) |
void |
setUriErrorsLogPath(ConfigPath cp) |
void |
start() |
void |
startCheckpoint(Checkpoint checkpointInProgress)
Note a checkpoint is about to begin.
|
void |
stop() |
protected ConfigPath path
protected boolean logExtraInfo
public static final char MANIFEST_CONFIG_FILE
public static final char MANIFEST_REPORT_FILE
public static final char MANIFEST_LOG_FILE
protected ConfigPath crawlLogPath
protected ConfigPath alertsLogPath
protected ConfigPath progressLogPath
protected ConfigPath uriErrorsLogPath
protected ConfigPath runtimeErrorsLogPath
protected ConfigPath nonfatalErrorsLogPath
protected boolean isRunning
protected Checkpoint recoveryCheckpoint
public ConfigPath getPath()
public void setPath(ConfigPath cp)
public boolean getLogExtraInfo()
public void setLogExtraInfo(boolean logExtraInfo)
public ConfigPath getCrawlLogPath()
public void setCrawlLogPath(ConfigPath cp)
public ConfigPath getAlertsLogPath()
public void setAlertsLogPath(ConfigPath cp)
public ConfigPath getProgressLogPath()
public void setProgressLogPath(ConfigPath cp)
public ConfigPath getUriErrorsLogPath()
public void setUriErrorsLogPath(ConfigPath cp)
public ConfigPath getRuntimeErrorsLogPath()
public void setRuntimeErrorsLogPath(ConfigPath cp)
public ConfigPath getNonfatalErrorsLogPath()
public void setNonfatalErrorsLogPath(ConfigPath cp)
public void start()
start
in interface org.springframework.context.Lifecycle
public boolean isRunning()
isRunning
in interface org.springframework.context.Lifecycle
public void stop()
stop
in interface org.springframework.context.Lifecycle
public void destroy()
destroy
in interface org.springframework.beans.factory.DisposableBean
protected void setupLogs() throws IOException
IOException
public Logger setupSimpleLog(String logName)
setupSimpleLog
in interface SimpleFileLoggerProvider
public void rotateLogFiles() throws IOException
IOException
protected void rotateLogFiles(String generationSuffix) throws IOException
IOException
protected void rotateLogFiles(String generationSuffix, boolean mergeOld) throws IOException
IOException
public void closeLogFiles()
public void addToManifest(String file, char type, boolean bundle)
file
- The filename (with absolute path) of the file to addtype
- The type of the filebundle
- Should the file be included in a typical bundling of
crawler files.MANIFEST_CONFIG_FILE
,
MANIFEST_LOG_FILE
,
MANIFEST_REPORT_FILE
public void startCheckpoint(Checkpoint checkpointInProgress)
Checkpointable
startCheckpoint
in interface Checkpointable
checkpointInProgress
- Checkpointpublic void doCheckpoint(Checkpoint checkpointInProgress) throws IOException
Default access only to be called by Checkpointer.
doCheckpoint
in interface Checkpointable
checkpointInProgress
- CheckpointException
IOException
public void finishCheckpoint(Checkpoint checkpointInProgress)
Checkpointable
finishCheckpoint
in interface Checkpointable
checkpointInProgress
- Checkpointpublic void setRecoveryCheckpoint(Checkpoint checkpoint)
Checkpointable
setRecoveryCheckpoint
in interface Checkpointable
checkpoint
- Checkpointpublic Logger getNonfatalErrors()
public Logger getProgressStats()
public Logger getRuntimeErrors()
public Logger getUriErrors()
public Logger getUriProcessing()
public int getAlertCount()
public void resetAlertCount()
public void logUriError(org.apache.commons.httpclient.URIException e, UURI u, CharSequence l)
logUriError
in interface UriErrorLoggerModule
e
- URIException encounteredu
- CrawlURI where problem occurredl
- String which could not be interpreted as URI without exceptionCopyright © 2003-2014 Internet Archive. All Rights Reserved.