cctklog4j.xml reference

 

Applies to: FAST Search Server 2010

Use the cctklog4j.xml file to control the logs created by the FAST Search Lotus Notes connector and the FAST Search database connector. This includes console logs, file logs, or a Microsoft FAST Search Server 2010 for SharePoint network logger. You can also specify the level of detail in these logs.

Warning

Any changes that you make to this file will be overwritten and lost if you:

  • Run the Set-FASTSearchConfiguration Windows PowerShell cmdlet.

  • Install a FAST Search Server 2010 for SharePoint update or service pack.

To avoid losing your changes, make sure that you back up this file after you have modified it.
Remember to reapply your changes after you run the Set-FASTSearchConfiguration Windows PowerShell cmdlet or install a FAST Search Server 2010 for SharePoint update or service pack.

The FAST Search connector reads the cctklog4j.xml file at startup for log configuration instructions. This configuration file sets a log level for each connector component, which provides a filter for the generated messages. For example, you can set INFO level logs for the main connector component, and ERROR level logs for the libraries used by the connector.

Note

To modify a configuration file, verify that you meet the following minimum requirements: You are a member of the FASTSearchAdministrators local group on the computer where FAST Search Server 2010 for SharePoint is installed.

Note

Logging uses the log4j Java utility. The cctklog4j.xml file includes links to Apache log4j documentation for additional reference.

Elements quick reference

There are three kinds of elements in cctklog4j.xml.

Element Type Description

Appenders

log4j uses an "appender" to define an output destination, such as the console or a file. You can configure three kinds of log appenders for the FAST Search connectors: console, rollingfile, and net. Each appender has a set of configuration parameters to control a specific log.

Logger

Each connector component has a separate log and log level; logger defines the destination and the level of verbosity for these logs.

Root

This element enables the appenders, and specifies a log level for components that are not explicitly configured.

cctklog4j.xml file format

XML elements in cctklog4j.xml begin with < and end with />.

The basic format is as follows:

<appender name=["value"]>

    <param name=["value"] value=["value"] />

    <layout class=["value"] >

        <param name=["value"] value=["value"] />

    </layout>

</appender>

<logger name=["value"]>

    <level value=["value"] />

</logger>

<root>

    <level value=["value"] />

    <appender-ref ref=["value"] />

</root>

For example:

<logger name="org.apache.axis.utils.JavaUtils">
     <level value="ERROR"/>
</logger>

Elements and attributes are case-sensitive, attribute values are not. Attribute values must be enclosed in quotation marks (" ").

An element definition can span multiple lines. Spaces, carriage returns, line feeds, and tab characters are ignored in an element definition.

For example:

<logger name="org.apache.axis.utils.JavaUtils">

    <level value="ERROR"/>

</logger>

Tip

For long element definitions, position attributes on separate lines and use indentation to make the file easier to read.

The <log4j:configuration> element is a special case and is required. All other elements are contained within the <log4j:configuration> element, and the element is closed with </log4j:configuration>.

You can add comments anywhere, delimited by <!-- and -->.

For example:

<!-- Setting the log level to ERROR avoids warnings about MIME -->
<logger name="org.apache.axis.utils.JavaUtils">
    <level value="ERROR"/>
</logger>

cctklog4j.xml appender elements reference

Appender elements define the logging output format and physical destination of the logs.

The elements are additionally specified with sub-parameters and layout classes.

cctklog4j.xml appender console element reference

Use the console appender to specify console output and message contents.

Attribute Value Description

ConversionPattern

%d{ABSOLUTE} %-5p [%c{1}] %m%n

Specifies the layout of the log message. See the Apache log4j documentation for detailed information.

Default: time, level, class name, and message

Example

The following example configures output with a specific message layout:

<appender name="console" class="org.apache.log4j.ConsoleAppender">
    <layout class="org.apache.log4j.PatternLayout">
        <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
    </layout>
</appender>

cctklog4j.xml appender rollingfile element reference

The rollingfile appender logs messages to a configured file until that file reaches a specified size. When the log file reaches the maximum size, the current file is renamed (a sequential number is added to the file name) and a new log file is created. This appender also controls the maximum number of files in a rolling set, and the contents of log messages.

Attribute Value Description

Append

true|false

If true, appends to existing files when the connector is started.

If false, starts from an empty file.

File

log/${cctk.module}connector.log

Path where the file will be written. Do not change this path. ${cctk.module} will be changed to lotusnotesconnector or jdbcconnector automatically at run time.

MaxFileSize

value

Specifies the maximum file size.

The next message will be written to a new file that uses the same name. The old file name is modified with an appended sequence number. You can also specify MB (megabytes) instead of KB.

Default: 5000KB

MaxBackupIndex

value

Specifies the maximum number of log files for the rotating logging. If all files have reached the maximum size, the oldest file is overwritten.

Default: 10

ConversionPattern

%d{ISO8601} %-5p [%c{1}] %m%n

See the Apache log4j documentation for detailed information.

Default: datetime, level, class name, and message.

Example

The following example sets up a rolling file appender, rotating on 10 log files of 5000 KB each:

<appender name="rollingfile" class="org.apache.log4j.RollingFileAppender">
    <param name="Append" value="true"/>
    <param name="File" value="log/${cctk.module}connector.log"/>
    <param name="MaxFileSize" value="5000KB"/>
    <param name="MaxBackupIndex" value="10"/>
    <layout class="org.apache.log4j.PatternLayout">
        <param name="ConversionPattern" value="%d{ISO8601} %-5p [%c{1}] %m%n"/>
    </layout>
</appender>

The files are named lotusnotesconnector.log.1, lotusnoteconnector.log.2, and so on Messages include time stamp, level, class name, and message content.

cctklog4j.xml appender net element reference

The net appender specifies the FAST Search Server 2010 for SharePoint network logger file name and message contents.

Note

The network log file is created automatically; do not change this element and attributes.

Attribute Value Description

LogHost

hostname

Automatically set by the installer; do not change.

LogPort

portnumber

Automatically set by the installer; do not change.

LogModuleName

${cctk.module}connector

Automatically set to the connector sending the logs at run time. Do not change.

Example

The following example locates the network logger at localhost, port 13415:

<appender name="net" class="com.fastsearch.esp.cctk.logging.ESPLogServerAppender">
    <param name="LogHost" value="localhost"/>
    <param name="LogPort" value="13415"/>
    <param name="LogModuleName" value="${cctk.module}connector"/>
</appender>

The module name in the logs is lotusnotesconnector or jdbcconnector.

cctklog4j.xml logger element reference

Use the logger element to define the level of verbosity in the logs for different connector components, which are defined through the package names for classes. The packages should be left as is (e.g., do not remove a logger), but you can change the level of verbosity.

Attribute Value Description

logger name

logger name

Specifies the connector component:

  • com.fastsearch.esp.cctk - defines the log level of CCTK (Connector Controller Tool Kit) messages.

  • org.apache.axis.utils.JavaUtils - defines the log level of MIME messages in content feed.

  • org.apache.commons.httpclient - defines the log level of cookie rejection messages.

  • com.fastsearch.esp.connectors.lotus - defines the log level of the FAST Search Lotus Notes content connector messages.

  • com.fastsearch.esp.connectors.lotus.userdirectory - defines the log level of the FAST Search Lotus Notes user directory connector messages.

  • com.fastsearch.esp.connectors.jdbc - defines the log level of the FAST Search database connector messages.

level value

logging level

Specifies the logging level:

  • INFO - logs all messages at INFO, WARN, and ERROR level.

  • DEBUG - logs all messages at DEBUG, INFO, WARN, and ERROR level.

  • WARN - logs all messages at WARN, and ERROR level.

  • ERROR - logs all messages at ERROR level.

  • TRACE - logs all messages at TRACE, DEBUG, INFO, WARN, and ERROR level.

Example

<logger name="com.fastsearch.esp.cctk">
    <level value="INFO"/>
</logger>

<logger name="org.apache.axis.utils.JavaUtils">
    <level value="ERROR"/>
</logger>

<logger name="org.apache.commons.httpclient">
    <level value="ERROR"/>
</logger>

<logger name="com.fastsearch.esp.connectors.lotus">
    <level value="INFO"/>
</logger>

<logger name="com.fastsearch.esp.connectors.lotus.userdirectory">
    <level value="INFO"/>
</logger>

<logger name="com.fastsearch.esp.connectors.jdbc">
    <level value="INFO"/>
</logger>

cctklog4j.xml root element reference

Use the root element to define log appenders that should be used and the level of verbosity for components that are not individually specified in the cctklog4j.xml configuration.

Attribute Value Description

level value

logging level

Specifies the logging level:

  • INFO - logs all messages at the INFO, WARN, and ERROR levels.

  • DEBUG - logs all messages at the DEBUG, INFO, WARN, and ERROR levels.

  • WARN - logs all messages at the WARN, and ERROR levels.

appender-ref ref

log

Specifies the log to enable:

  • console - enables the console log.

  • rollingfile - enables the rolling file log.

  • net - enables the FAST Search Server 2010 for SharePoint network logging.

Example

<root>

    <level value="WARN"/>

    <appender-ref ref="console"/>

    <appender-ref ref="rollingfile"/>

    <appender-ref ref="net"/>

</root>