OSGI Log Reader (Aspire 2)

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

For Information on Aspire 3.1 Click Here


OSGI Log Reader (Aspire 2)
Factory Name  com.searchtechnologies.aspire:aspire-tools
subType  feederOverview
Inputs  OSGI log reader service
Outputs  Log files


The OSGI Log Reader allows the Aspire system to log all messages with a severity above debug to a single file. The OSGI log reader is a component itself and uses the standard component logging and therefore:

  • Messages are logged at various levels to a specific file
  • The last n messages are kept in memory and can be reported back via the status page
  • The log file may be rotated on demand while the log reader is running

All log files are written under the $ASPIRE_HOME directory. The actual path for the log file is configured in the component's XML configuration. Log files are rotated on a daily basis, or on a configurable size limit. Rotated log files receive a time stamp upon rotation. The last n messages are kept locally for display. Messages kept locally (for view via the status page) are truncated to 200 characters.

Configuration

Element Type Default Description
logfile string log/aspireOSGISystem.log The name of the file to write log messages to.
maxFileSize int 10Mb The maximum size of the log file before automatic rotation to a new file.
keepMessages int 1000 The number of messages to retain locally for display via the status page.
minLogLevel string info The minimum log level message written to the log file. Change the value to warn to prevent info message from being written to the log file.

Example Configurations

Simple

  <component name="log" subType="osgiLogReader" factoryName="aspire-tools">
    <logFile>log/aspireOSGIlog.log</logFile>
    <maxFileSize>209715200</maxFileSize>
  </component>

Complex

  <component name="log" subType="osgiLogReader" factoryName="aspire-tools">
    <logFile>log/aspireOSGIlog.log</logFile>
    <maxFileSize>2097152000</maxFileSize>
    <keepMessages>2000</keepMessages>
    <minLogLevel>warn</minLogLevel>
  </component>

Controlling the OSGI Log Reader via the component

In addition to the view and rotate the log (see Logging) you may also:

  • Change the number of messages kept locally for display by issuing the command keep to the component and adding the parameter numMsg=
    e.g., http://blade3:50505/aspire/systemCommon/log?cmd=keep&numMsg=1000
  • Change the minimum log message level written to the log file by issuing the command minLevel to the component and adding the parameter level=
    e.g., http://blade3:50505/aspire/systemCommon/log?cmd=minLevel&level=warn
  • Cause the log file to be rotated by issuing the command rotate to the component
    e.g., http://blade3:50505/aspire/systemCommon/log?cmd=rotate