GridGain™ 3.6.0e
Enterprise Edition

org.gridgain.grid.logger
Interface GridLogger

All Superinterfaces:
GridMetadataAware, Serializable
All Known Implementing Classes:
GridJavaLogger, GridJbossLogger, GridJclLogger, GridLog4jLogger, GridSlf4jLogger, GridTomcatLogger

@GridToStringExclude
public interface GridLogger
extends GridMetadataAware

This interface defines basic logging functionality used throughout the system. We had to abstract it out so that we can use whatever logging is used by the hosting environment. Currently, log4j, JBoss, JCL and console logging are provided as supported implementations.

GridGain logger could be configured either from code (for example log4j logger):

      GridConfiguration cfg = new GridConfigurationAdapter();
      ...
      URL xml = U.resolveGridGainUrl("modules/tests/config/log4j-test.xml");
      GridLogger log = new GridLog4jLogger(xml);
      ...
      cfg.setGridLogger(log);
 
or in grid configuration file (see JCL logger example below):
      ...
      <property name="gridLogger">
          <bean class="org.gridgain.grid.logger.jcl.GridJclLogger">
              <constructor-arg type="org.apache.commons.logging.Log">
                  <bean class="org.apache.commons.logging.impl.Log4JLogger">
                      <constructor-arg type="java.lang.String" value="config/default-log4j.xml"/>
                  </bean>
              </constructor-arg>
          </bean>
      </property>
      ...
 
It's recommended to use GridGain's logger injection instead of using/instantiating logger in your task/job code. See GridLoggerResource annotation about logger injection.

Quiet Mode

By default GridGain 3.0 starts in "quite" mode suppressing INFO and DEBUG log output. If system property GRIDGAIN_QUIET is set to false than GridGain will operate in normal un-suppressed logging mode. Note that all output in "quiet" mode is done through standard output (STDOUT).

Note that GridGain's standard startup scripts $GRIDGAIN_HOME/bin/ggstart.{sh|bat} start by default in "quiet" mode. Both scripts accept -v arguments to turn off "quiet" mode.

Wiki & Forum:


Wiki
Forum

 

Method Summary
 void debug(String msg)
          Logs out debug message.
 void error(String msg)
          Logs out error message.
 void error(String msg, Throwable e)
          Logs error message with optional exception.
 GridLogger getLogger(Object ctgr)
          Creates new logger with given category based off the current instance.
 void info(String msg)
          Logs out information message.
 boolean isDebugEnabled()
          Tests whether debug level is enabled.
 boolean isInfoEnabled()
          Tests whether info level is enabled.
 boolean isQuiet()
          Tests whether info and debug levels are turned off.
 void warning(String msg)
          Logs out warning message.
 void warning(String msg, Throwable e)
          Logs out warning message with optional exception.
 
Methods inherited from interface org.gridgain.grid.GridMetadataAware
addMeta, addMetaIfAbsent, addMetaIfAbsent, allMeta, copyMeta, copyMeta, hasMeta, hasMeta, meta, putMetaIfAbsent, putMetaIfAbsent, removeMeta, removeMeta, replaceMeta
 

Method Detail

getLogger

GridLogger getLogger(Object ctgr)
Creates new logger with given category based off the current instance.

Parameters:
ctgr - Category for new logger.
Returns:
New logger with given category.

debug

void debug(String msg)
Logs out debug message.

Parameters:
msg - Debug message.

info

void info(String msg)
Logs out information message.

Parameters:
msg - Information message.

warning

void warning(String msg)
Logs out warning message.

Parameters:
msg - Warning message.

warning

void warning(String msg,
             @Nullable
             Throwable e)
Logs out warning message with optional exception.

Parameters:
msg - Warning message.
e - Optional exception (can be null).

error

void error(String msg)
Logs out error message.

Parameters:
msg - Error message.

error

void error(String msg,
           @Nullable
           Throwable e)
Logs error message with optional exception.

Parameters:
msg - Error message.
e - Optional exception (can be null).

isDebugEnabled

boolean isDebugEnabled()
Tests whether debug level is enabled.

Returns:
true in case when debug level is enabled, false otherwise.

isInfoEnabled

boolean isInfoEnabled()
Tests whether info level is enabled.

Returns:
true in case when info level is enabled, false otherwise.

isQuiet

boolean isQuiet()
Tests whether info and debug levels are turned off.

Returns:
Whether info and debug levels are turned off.

GridGain™ 3.6.0e
Enterprise Edition

GridGain - Real Time Big Data
Enterprise Edition, ver. 3.6.0e.13012012
2012 Copyright © GridGain Systems
Follow us:   Follow GridGain on Github Follow GridGain on Facebook Join GridGain User Group Follow GridGain on Twitter Follow GridGain on YouTube