GigaSpaces Logging

Search XAP 7.0
Searching XAP 7.0.X Documentation
Browse XAP 7.0
Offline Documentation

Download latest offline documentation in HTML format:
xap-7.0.2-documentation.zip (12.3MB)

                                                              

Overview

GigaSpaces makes logging calls by use of the Java TM platform's core logging facilities.
For more information on the JDK logging framework, please refer to the following online documentation: Java Logging Overview.

Configuration File

The logging configuration is initialized using a logging configuration file that is read at startup. This logging configuration file is in the standard java.util.Properties format. It configures custom versions of both java.util.logging.Handler and java.util.logging.Formatter, and default levels for frequently used loggers (categories).

The default configuration file is located under:

<GigaSpaces>/config/gs_logging.properties

Overriding the Default Configuration

The configuration defined in the gs_logging.properties file may be overridden by either using system properties or by providing an external configuration file with overrides. This external configuration file should be located in the classpath under:

/config/gs_ext_logging.properties

Any configuration that you wish to override in gs_logging.properties file, should appear in gs_ext_logging.properties with its new value. The same applies for system properties, e.g.

-Dcom.gigaspaces.exceptions.level=WARNING

Defining System Properties when Starting GSCs, GSMs and other runtime components

The recommended way to define system properties when starting service grid components is to wrap the original script, e.g. gsc.sh(bat) with a wrapper script which include the EXT_JAVA_OPTIONS variable. The setenv.sh(bat) script which is used by these components will pick these options automatically and use them as JVM arguments.

Overriding the Configuration File

Your own configuration file may also be used instead of the platform's default. This is done by setting the configuration file location using a system property:

-Djava.util.logging.config.file=myfile.properties

GigaSpaces scripts rely on the exported environment variable GS_LOGGING_CONFIG_FILE (declared in <GigaSpaces>/bin/setenv script). The preferred way to apply your override file is to use a wrapper script: export the new setting of this variable and call the original script. This ensures that when setenv.sh(bat) is called from within the platform's scripts, it will pick up the override.

# unix
export GS_LOGGING_CONFIG_FILE=myfile.properties
./gsc.sh

Provided that your application initializes the logging facility via the Logging API (e.g. LogManager.readConfiguration(InputStream ins)), you may wish to disable the GigaSpaces configuration altogether. Once disabled, your Java logging settings will take place. This is done with the following system property:

-Dcom.gs.logging.disabled=true

Troubleshooting

To troubleshoot and detect which logging properties file was loaded and from which location, use the following system property:

-Dcom.gs.logging.debug=true

Handlers

GigaSpaces configures logging with two log {{Handler}}s.

  • java.util.logging.ConsoleHandler: A simple handler for writing formatted output to System.err (level is set to ALL)
  • com.gigaspaces.logger.RollingFileHandler: A handler that writes formatted output to a file that rolls over if a certain policy is triggered. see Managing Log Files

Formatters

Formatters are in charge of formatting the log messages and adding meta data to them (date, time, level, etc).
GigaSpaces configures the logging Handler's formatter property with a single Formatter implementation class:
com.gigaspaces.logger.GSSimpleFormatter. This formatter class is based on the java.util.logging.SimpleFormatter class. see Formatting Log Messages for more details.

Exception visibility

GigaSpaces prints exception stack traces for messages with level SEVERE or higher.

com.gigaspaces.exceptions.level = SEVERE

Messages with lower levels with only be logged with the exception's toString() value. To force the logger to print the stack trace of exception with lower levels, such as Level WARNING for example, set the com.gigaspaces.exceptions.level property to WARNING.

Note that if the exception is a java.lang.RuntimeException its stack trace will always be logged, regardless of the level definition.

Logging Management at Runtime

It is possible to change various logger level settings while the system is up and running without the need to restart it.
This can be very useful in production environments when the system needs to be troubleshooted, but at the same time cannot be restarted.

You can do so by connecting to the JMX Bean of the Java logging facility via JConsole for example.
You can start JConsole for a specific running GSC or GSM using the GigaSpaces Managment Center (<GigaSpaces>\bin\gs-ui.sh(bat)).
To change the logging level in JConsole do the following:

  1. Traverse to the MBeans tab
  2. Expand the java.util.logging tree node and locate the Logging tree node
  3. Select the Operations tab
  4. Type the logger's name and level for the arguments of the setLoggerLevel() method. For example, If you want to change com.gigaspaces.exceptions.level level to WARNING, use setLoggerLevel(com.gigaspaces.exceptions, WARNING).

The LoggingMXBean enables you to:

  • Get the name of the log level associated with the specified logger
  • Get the list of currently registered loggers
  • Get the name of the parent for the specified logger
  • Sets the specified logger to the specified new level

.NET bridge

The logging configuration file includes declarations of the loggers available at the bridge between .NET and Java.
For more details, refer to the .NET Logging and Tracing section.

#DOTNET Bridge
com.gigaspaces.externaldatasource.dotnet.level = INFO
com.gigaspaces.bridge.dispatcher.level = INFO
com.gigaspaces.bridge.pbsexecuter.level = INFO

C++ Bridge

The logging configuration file includes declarations of the C++ Java Proxy logger, which logs info such as exceptions and JVM creation.

#C++
com.gigaspaces.cpp.proxy.level = INFO

FAQ

How do I minimize cost when migrating to 7.0 ?

Section Contents

IMPORTANT: This is an old version of GigaSpaces XAP. Click here for the latest version.

Labels

 
(None)