Log profile Log4j subsystem properties

Description

These properties configure the output from a logging profile that uses the Apache Log4j logging system. All properties in the logging profile are applied to the Log4j configuration. Only those properties used in the preconfigured Log4j profiles are documented here. For information on other properties, see the Apache Log4j Documentation.

See also

Log profile properties, com.sybase.jaguar.logprofile.subsystem




log4j.rootLogger

Description

Configures the Log4j root log level and appenders.

Syntax

level[, appenders]

Where level is one of the error levels listed in Table B-15, as defined in class org.apache.log4j.Level. The error level specifies which messages are logged. Only messages of the specified level or greater severity are logged. Table B-15 lists the levels in ascending order of severity.

Table B-15: Log4j error levels

Level

To indicate

ALL

All messages are logged.

DEBUG

Debug messages are logged.

INFO

Informational messages are logged, for example, a listener has been established or the name service has finished binding installed components.

WARN

Warning messages are logged. For example, the server is in a cluster and other members are not found.

ERROR

An error has occurred that prevents completion of a requested action. For example, a component has thrown an uncaught exception and its transaction is being rolled back.

FATAL

An error has occurred that indicates the server should terminate.

OFF

No messages are logged.

appenders specifies an optional comma-separated list of appenders. In Log4j, an appender specifies how messages are logged, for example, to the console or to a file. Each appender must be configured by setting additional properties, prefixed with log4j.appender.name, where name is the appender name.

See also

log4j.logger.<logger-name>, log4j.logger.<logger-name>




log4j.logger.<logger-name>

Description

Configures the log output for the logger specified by <logger-name>.

Syntax

Same as for log4j.rootLogger.

Usage

This property configures the log output properties for a logger name used in code. Logger names are a logical means to categorize messages, and setting this property allows you to configure the output for messages written to the specified logger. EAServer uses the logger names listed in Table B-8. The same names are used for Log4j logger names, EAS log subsystem categories, and java.util.logging logger names.

You can add additional properties to configure logger names used in your own code. If not configured explicitly, loggers inherit configurations from their parent in the prefix-based name hierarchy. For example, a logger named com.sybase.jaguar inherits the settings for com.sybase, unless you explicitly configure com.sybase.jaguar. If there is no logger configured with a prefix name, loggers inherit the root logger settings specified by log4j.rootLogger.

For example, this setting configures messages written to the logger named com.sybase.jaguar.servlet. As a result, only messages with severity level INFO or greater are logged, and messages to this logger go to the output configured for the appender eas_servlet:

log4j.logger.com.sybase.jaguar.servlet=INFO, eas_servlet

See also

log4j.rootLogger, log4j.additivity.<logger-name>




log4j.additivity.<logger-name>

Description

Configures additivity for the logger, that is, whether messages written to the logger go only to destinations configured explicitly for this logger or also go to destinations configured for the parent in the hierarchy.

Syntax

true or false. If not specified, the default is true.

Examples

Example 1

These settings configure the output for the com.sybase logger and the com.sybase.jaguar.servlet logger to use separate destinations (specified in the configuration of the eas and eas_servlet appenders, respectively). The additivity is false for the com.sybase.jaguar.servlet logger. If the log4j.additivity.com.sybase.jaguar.servlet property were not set to false, the servlet log output would go to both destinations:

log4j.rootLogger=INFO, eas
log4j.logger.com.sybase=INFO
log4j.logger.com.sybase.jaguar.servlet=INFO, eas_servlet
log4j.additivity.com.sybase.jaguar.servlet=false

See also

log4j.logger.<logger-name>




log4j.appender.<name>

Description

Specifies the class that writes messages for appender <name>, where <name> is an appender name specified in a log4j.rootLogger or log4j.logger.<logger-name> setting.

Syntax

The full name of an instantiable Java class that implements the org.apache.log4j.Appender interface. Examples used in the default EAServer Log4j configuration include:

Appender class

Description

org.apache.log4j.FileAppender

Logs messages to a text file

org.apache.log4j.ConsoleAppender

Logs messages to the console (standard output or standard input)

Log4j includes other appenders and you can implement your own. See the Apache Log4j Documentation for more information. If you implement your own classes, make sure they are in the CLASSPATH and BOOTCLASSPATH for the EAServer process.

See also

log4j.appender.<appender-name>.Append, log4j.appender.<appender-name>.File, log4j.appender.<appender-name>.layout, log4j.appender.<appender-name>.layout.ConversionPattern, log4j.appender.<appender-name>.target




log4j.appender.<appender-name>.Append

Description

For appenders that use org.apache.log4j.FileAppender, specifies whether the output file is opened for appending or truncated.

Syntax

true or false. A value of true specifies that the output file must be appended to. If you specify false, the server log files are truncated each time you restart the server.

See also

log4j.appender.<name>




log4j.appender.<appender-name>.File

Description

For appenders that use org.apache.log4j.FileAppender, specifies the output file name and location.

Syntax

The full path to the output file, using ‘/’ (forward slash) as the directory separator. You can use the placeholders described in Table B-16:

Table B-16: File name and path placeholders

Placeholder

Specifies

${JAGUAR}

The EAServer installation directory (specified by the JAGUAR environment variable)

${JAGEXEDIR}

The location of binaries in the EAServer installation ($JAGUAR/bin on most platforms)

${JAGSRVNAME}

The server name, as displayed in EAServer Manager

See also

log4j.appender.<name>




log4j.appender.<appender-name>.layout

Description

Specifies the layout class for the appender.

Syntax

The full name of an instantiable Java class that implements org.apache.log4.Layout, for example:

org.apache.log4j.PatternLayout

See also

log4j.appender.<appender-name>.layout.ConversionPattern




log4j.appender.<appender-name>.layout.ConversionPattern

Description

For appenders that use layout org.apache.log4j.PatternLayout, specifies the pattern to format the log message contents.

Syntax

See the description of the pattern string in the org.apache.log4j.PatternLayout documentation.

See also

log4j.appender.<appender-name>.layout




log4j.appender.<appender-name>.target

Description

For appenders that use org.apache.log4j.ConsoleAppender, specifies whether to write to standard output or standard error.

Syntax

One of the following values:

Value

Specifies

System.out

Standard output.

System.err

Standard error.

See also

log4j.appender.<name>