Starting the server  Configuring server stack size

Chapter 3: Creating and Configuring Servers

Configuring log profiles

A server’s logging properties are defined in a Log Profile, which defines the logging subsystem used as well as other properties, such as output destinations, formats, and the level of severity required before a message is recorded. You can also configure different log profiles for the debug and production server versions.

EAServer supports industry-standard Java logging APIs, and provides APIs to log messages from components of other types. You can use the following logging subsystems:

If you use Log4j or Java Logging, you can extend default behavior by plugging in your own code that implements the required interfaces. For example, you can install Log4j log handler classes that write messages to the Windows event log or to a database. Also, if you want one of these packages to log messages from your own component or application code, you can configure the server’s log profile so that server log messages go to the same destinations. In addition, if you use Log4j or the Java Logging system, you can log messages from in-server Java code by calling the logging API directly.

NoteUsing legacy logging methods Regardless of the logging system you use, you can write messages to the log using all of the methods supported in earlier versions of EAServer, such as:

Log output from these legacy methods can be configured using the srv_log logging category.


Configuring the server’s log profile

To change the log profile used in a server, display the Log/Trace tab in the Server Properties dialog box. To change the profiles using jagtool, set the following server properties:

EAServer installs several predefined log profiles, as listed in Table 3-12.

Table 3-12: Preconfigured log profiles

Profile name

Description

debug

Default logging profile for debug servers. Supports the logging mechanism used in versions of EAServer earlier than 5.0.

prod

Default logging profile for production servers. Supports the logging mechanism used in versions of EAServer earlier than 5.0.

debug_jdk

Supports the JDK 1.4 java.util.logging package, configured for use in debug servers. The server must be started with JDK 1.4 to use this profile.

prod_jdk

Supports the JDK 1.4 java.util.logging package, configured for use in production servers. The server must be started with JDK 1.4 to use this profile.

debug_l4j

Supports Log4j, configured for use in debug servers.

prod_l4j

Supports Log4j, configured for use in production servers.


Configuring log profiles

You can configure log profiles in EAServer Manager or in a text editor.

StepsDefining a new log profile

The easiest way to define a new log profile is to copy one of the existing definitions to a file, edit the file, then import the definition in Jaguar Manager as follows:

  1. Copy the predefined log profile that is closest to the characteristics that you want, specifying a new file name with the .props extension.

  2. Open the file in a text editor, and change the value of the com.sybase.jaguar.logprofile.name to match the base name. You can edit the remaining properties after importing the profile, using the Log Profile Configuration wizard.

  3. Import the profile to EAServer Manager as follows:

    1. Start EAServer Manager if it is not already running.

    2. Highlight the Log Profiles folder in the left pane and choose File | Import.

    3. Specify the file name you created and click OK.

    4. You should see the new profile in the Log Profiles folder.

You can also create a log profile using the New Log Profile wizard.

StepsCreating a log profile using the New Log Profile wizard

  1. In EAServer Manager, highlight the Log Profiles folder, and select File | New Log Profile Wizard.

    The wizard guides you through the process of creating a log profile.

StepsConfiguring log profiles

To configure log profiles, you can use either the Log Profile Configuration wizard or the Log Profile Properties page. The Log Profile Configuration wizard guides you through the basic steps required to configure a log profile for an EAS, Java Logging, or Log4j logging subsystem.

  1. From within EAServer Manager, display the list of log profiles by expanding the Log Profiles folder.

  2. Highlight the log profile you want to configure.

  3. Select File | Configuration Wizard or File | Properties.

    NoteTo find property descriptions for Log4j and Java Logging subsystems, see:

  4. To change the other properties, double-click the log profile name in the left pane to display the following:

StepsExporting log profiles

You can export log profile settings to a file. This is useful when you want to use the settings to control logging from Java client applications as described in “Using log profiles in Java client applications”. Export log profile settings as follows:

  1. Highlight the Log Profile and Choose File | Export.

  2. Specify the directory to export the file to, then choose Save. EAServer Manager creates profile.props in the specified directory, where profile is the name of the logging profile.


Category names

Category names map to the various subsystems of EAServer. Different subsystems can use different category names for log messages, and you can configure the output for each category. Table 3-13 lists the category names used in EAServer. Many of these are not used in the preconfigured log profiles, but you can add them.

StepsConfiguring a log category using the Log Category Configuration wizard

The Log Category Configuration wizard guides you through the process of configuring a log category.

  1. From within EAServer Manager, display the list of log profiles by expanding the Log Profiles folder.

  2. Expand a log profile, then expand the Categories folder.

  3. Highlight the log category you want to configure.

  4. Select File | Configuration Wizard.

Table 3-13: Log category names used in EAServer

Category name

Used by

<root>

N/A. This category is used as the default parent for categories for which a parent category is not specified.

axdisp

The ActiveX component dispatcher.

com.sybase

All EAServer internal subsystems that do not specify another name.

com.sybase.CORBA

CORBA component dispatcher systems that do not use another name.

com.sybase.CORBA.cts

Parent category for the following categories that use this prefix in the name.

com.sybase.CORBA.cts.HeapStorage

The CtsComponents/HeapStorage storage component that manages in-memory replication of EJB session bean state and HTTP session state.

com.sybase.CORBA.cts.JdbcStorage

The CtsComponents/JdbcStorage storage component that manages database storage of EJB CMP entity bean data, EJB session bean state, and HTTP session state.

com.sybase.CORBA.cts.MessageService

The EAServer message service.

com.sybase.CORBA.cts.MessageService. network

The EAServer message service, for debug messages related to network connectivity (logged when the cms.debug.network message service property is set to true).

com.sybase.CORBA.cts.MessageService. session

The EAServer message service for messages related to session connectivity (logged when the cms.debug.session message service property is set to true).

com.sybase.CORBA.cts.ObjectCache

The object cache, which creates and manages the caches used for servlet and JSP response caching and entity component query and instance caching.

com.sybase.CORBA.cts.ThreadManager

The thread manager, which provides an API to run components asynchronously.

com.sybase.CORBA.iiop

The Java client runtime IIOP subsystem, for logging of errors.

com.sybase.CORBA.iiop.giop

The Java client runtime IIOP subsystem, for logging of General Inter-Orb Protocol (GIOP) trace data (if GIOP tracing is enabled).

com.sybase.CORBA.iiop.iiop

The Java client runtime IIOP subsystem, for logging of IIOP trace data (if IIOP tracing is enabled).

com.sybase.CosNaming

The EAServer naming service.

com.sybase.CosNaming.console

The EAServer naming service, to output messages to the console during server initialization. (You can override the default destination so these messages do not go to the console.)

com.sybase.ejb.lwc

The EJB component lightweight container.

com.sybase.jaguar.deployment

The server-side deployment subsystem.

com.sybase.jaguar.importer

The client-side deployment subsystem (used when importing J2EE archives, Java class and interface definitions, and ActiveX interfaces among other things).

com.sybase.jaguar.jcm

The Java connection cache manager.

com.sybase.jaguar.jcm.cm

The Java connection cache manager, for messages related to connector management.

com.sybase.jaguar.jcm.sm

The connection cache manager, for messages related to security.

com.sybase.jaguar.management

Internal configuration management Java classes.

com.sybase.jaguar.packager

The deployment subsystem, when exporting J2EE archives.

com.sybase.jaguar.server

Server subsystems that don’t use another name.

com.sybase.jaguar.server.cl

Server Java class loader.

com.sybase.jaguar.server.cl.copy

Server Java class loader, when creating temporary copies of JAR files.

com.sybase.jaguar.server.hsb

Server hot standby system.

com.sybase.jaguar.servlet

The EAServer servlet engine.

com.sybase.jaguar.servlet,cl

The servlet engine class loader.

com.sybase.jaguar.servlet.hsc

The servlet engine HTTP session context manager.

com.sybase.jaguar.servlet.security

The servlet engine security manager.

com.sybase.jms

The message service JMS API implementation.

libjagcm

Native connection cache manager.

libjcc

The C++ client runtime implementation (used by C++, PowerBuilder, and ActiveX clients as well as Java application clients that use the EAServer SSL implementation).

libjdispatch

Native component dispatcher code.

libjdispatch.iiop

Server-side IIOP protocol handler code.

libjdispatch.iiop.read

Server-side IIOP protocol handler code, read handling.

libjdispatch.iiops

Server-side IIOPS protocol handler code.

libjdispatch.management

Native code called from the management API (for example, when restarting or refreshing the server).

libjdispatch.monitoring

Native code called from the monitoring API.

libjdispatch.nip

Named instance pool implementation.

libjdispatch.nipmgr

Named instance pool manager.

libjdispatch.transaction

Native transaction manager code.

libjhttp.dynamo

PowerDynamo integration subsystem.

libjhttp.log

Native in-server HTTP protocol handler code.

libjhttp.statlogger

Native in-server HTTP protocol handler code, statistics provider implementation.

libjjdk12

The server subsystem that manages the creation and configuration of the in-server Java VM.

libjots

Server-side object transaction service implementation.

srv_log

Output from the legacy logging methods such as:

  • System.out.println or Jaguar.writeLog from Java code running in the server

  • ErrorLogging.log from PowerBuilder NVO components

  • JagLog from C or C++ components

  • IJagServer.writeLog from ActiveX components


Category properties

Table 3-14 describes the category settings.

Table 3-14: Logging category settings

Tab name / Setting name

Specifies

General / Description

An optional description.

Options / Level

The logging level. Only messages of equal or greater severity are logged. Table 3-15 describes the severity codes.

Options / Use Parent Handlers

Whether to log to the parent category handlers as well as the handler associated with this category.

Options / Parent

The parent category.

Options / Resource Bundle

The name of a Java resource bundle containing localized messages that are logged from Java code. If this property is not set, the default resource bundle is the class ResourceBundle in the package with the same name as the category. For example, the default resource bundle for the category com.sybase.jaguar.server is com.sybase.jaguar.server.ResourceBundle.

Handler

One or more logging handler names. The handler properties specify how and where messages are logged. See “Handler properties” for more information.

Table 3-15 lists the severity level codes. You can set the logging level in the category to discard messages below a specified severity level.

Table 3-15: EAS log subsystem error levels

Level

To log

ALL

All messages.

CONFIG

Configuration errors. You should correct these problems.

ERROR

Errors that prevent completion of a requested action. For example, a component has thrown an uncaught exception and its transaction is being rolled back.

FATAL

Errors that indicate the server should terminate.

DEBUG

Debug messages.

FINE

Debug messages.

FINER

Has same effect as FINE.

FINEST

Has same effect as FINE.

INFO

Informational or status messages. For example, the name server has finished binding components.

OFF

No messages are logged.

WARN

Warning messages. For example, a warning might be that the server is in a cluster and other members are not found.


Handler properties

Handlers specify how and where messages are logged. You can associate handlers with categories to configure the output of messages from that category. Table 3-16 describes the handler settings.

StepsConfiguring a log handler using the Log Handler Configuration wizard

The Log Handler Configuration wizard guides you through the process of configuring a log handler.

  1. From within EAServer Manager, display the list of log profiles by expanding the Log Profiles folder.

  2. Expand a log profile, then expand the Handlers folder.

  3. Highlight the log handler you want to configure.

  4. Select File | Configuration Wizard.

Table 3-16: Handler settings

Tab name / Setting name

Specifies

General / Description

An optional description.

Type / Type

The output type. Choose one of the following:

  • file – outputs to a text file.

  • console – outputs to the console (standard output or standard error).

  • null – no output.

Type / File Name

When logging to a file, the pattern string to name the output file. You can use the placeholders in Table 3-17.

Type / Truncate Log File

Whether to truncate the log file when the server starts. If truncation is not enabled, log messages from the server process are appended to those from the previous process. With truncation enabled, you can keep the previous log contents by enabling archiving (recommended) or rotation.

Type / Max Size

The maximum allowed size before archiving or rotating the log file. Use one of the following values:

  • -1 – to specify no limit.

  • nm – to specify n megabytes (with n a positive integer).

  • nk – to specify n kilobytes (with n a positive integer).

Type / Max Time

The maximum amount of time before archiving or rotating the log file; enter as HH:MM.

Type / Rotate at Max

Whether to rotate log files at start-up and when the maximum size or time is reached. If you enable rotation, the log file is renamed with a sequential numeric extension when a new file is started. For example, if the file is Jaguar.log, previous versions are named Jaguar.log.1, Jaguar.log.2, and so forth.

Type / Archive Log Files

Whether to archive log files at start-up and when the maximum size is reached.

Type / Archive File Name

If archiving is enabled, the pattern string to name the archived log files. You can use the placeholders in Table 3-17.

Type / Compress Archive File

If archiving is enabled, whether to compress the archived files. If you enable compression, the resulting archive name is the specified archive file name plus the “.zip” extension.

Type / Console Type

When writing to the console, the destination device. Choose stdout for standard output, and stderr for standard error.

Type / Host Name

When writing to a socket, the host name to connect the socket to.

Type / Port

When writing to a socket, the port number to connect the socket to.

When specifying log file names and archive file names, you can use the placeholders in Table 3-17.

Table 3-17: Log 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.

%t

The time of day when the file was created, formatted as HHMMSS.

%d

The date (day of month, month, and year) when the file was created, formatted as DDMMYYYY.


Formatter properties

Formatters specify the format of logged messages. You can associate a formatter with a handler to specify the format of messages logged through the handler. Table 3-18 describes the formatter properties.

StepsConfiguring a log formatter using the Log Formatter Configuration wizard

The Log Formatter Configuration wizard guides you through the process of configuring a log formatter.

  1. From within EAServer Manager, display the list of log profiles by expanding the Log Profiles folder.

  2. Expand a log profile, then expand the Formatter folder.

  3. Highlight the log formatter you want to configure.

  4. Select File | Configuration Wizard.

Table 3-18: Formatter settings

Tab name / Setting name

Specifies

General / Description

An optional description.

Type / Message Format

The format pattern for the message text, using the placeholders listed in Table 3-19. You can use the Insert Tag control to insert these placeholders, or type them yourself.

Type / Insert Tag

When editing the message format, use this control to insert the placeholder tags.

Type / Simple Date Format

The format for timestamps in log messages. The pattern for the timestamps embedded in log messages, as converted to strings by java.text.SimpleDateFormat. For details, see the DateFormat API documentation.

Table 3-19 lists the placeholders that you can use when specifying the message format pattern. Each placeholder represents part of the message.

Table 3-19: Message format placeholders

Placeholder

Represents

%LN

The logging category name

%MC

Message code (number)

%ML

Message level (severity)

%MT

Message text

%PT

Processed message text, which consists of the message number (if specified when the message was logged) and the message text

%SN

Sequence number

%SF

Source file name

%SL

Line number in the source file

%SM

Method name in the source file

%TI

Thread ID (enabled by setting server property com.sybase.jaguar.server.logspid)

%TH

Exception thrown (if available)

%TS

The timestamp, formatted as specified by the Simple Date Format setting

%NL

A line break


Using log profiles in Java client applications

The EAServer Java client runtime classes also use the EAServer logging system. By default, the log level is ERROR and messages are sent to the console. You can change the client logging settings by specifying a configuration file. The same procedure works for Java/CORBA and EJB clients, as well as EAServer Manager and jagtool.

StepsSpecifying log settings for Java client applications

  1. Use EAServer Manager to create a log profile with the desired settings and export the settings to a properties (.props) file.

  2. When running the application, specify the logging properties to use by setting the Java system property com.sybase.jaguar.logger.config.file to the path and file name of the properties file. For example, to specify the system property on the command line, use syntax like this:

    java -Dcom.sybase.jaguar.logger.config.file=mylog.props \
       com.mycompany.MyClient
    




Copyright © 2005. Sybase Inc. All rights reserved. Configuring server stack size