Job Logger (Aspire 2)

From wiki.searchtechnologies.com
Jump to: navigation, search

For Information on Aspire 3.1 Click Here


Job Logger (Aspire 2)
Factory Name  com.searchtechnologies.aspire:aspire-tools
subType  jobLogger
Inputs  The entire job
Outputs  The input job is sent, unmodified, to the output, after logging

The Job Logger is a useful debugging tool for viewing jobs which flow through Aspire pipelines. It both writes jobs to a log file (if a log file is specified) and also captures the last "numJobs" jobs in memory to be displayed on the admin interface.

WARNING: This job logger creates all the directories required to create the logFile. Naturally, this makes it easier to use, but it does mean you need to be careful about where the log file is stored.


Configuration

Element Type Default Description
logFile String null (Optional) Specifies the file name to which jobs are logged. If missing, then no log file will be created. Note that directories required for the log file will be automatically created.

Automatically creates the directories necessary to contain the log file if they don't already exist.

If the log file already exists, first it checks for a ".bak" version of the file. If that exists it is deleted. Then it renames the current file to ".bak", and creates the new file.

enable boolean true If true, enables logging. Otherwise, logging is only done when the debug flag is set for the component (via the admin interface).
numJobs int 5 Specifies how many of the most recent jobs will be displayed from the admin interface. Set this number to zero if you don't want to keep any files in memory (i.e. just write to the log file), which you may prefer to do if your documents are very large and therefore may use up a lot of memory.

Example Configuration

Simple

<component name="JobLogger" subType="jobLogger" factoryName="aspire-tools">
  <enable>true</enable>
</component>

Complex

<component name="JobLogger" subType="jobLogger" factoryName="aspire-tools">
  <enable>${debug}</enable>
  <logFile>log/${app.name}/incomming.jobs</logFile>
</component>

Example Output

...