org.apache.ignite

## Interface IgniteLogger

All Known Implementing Classes:
  GridLoggerProxy, JavaLogger, NullLogger

    @GridToStringExclude
    public interface IgniteLogger

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.

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

          IgniteConfiguration cfg = new IgniteConfiguration();
          ...
          URL xml = U.resolveIgniteUrl("config/custom-log4j.xml");
          IgniteLogger log = new Log4JLogger(xml);
          ...
          cfg.setGridLogger(log);

or in grid configuration file (see JCL logger example below):

          ...
          <property name="gridLogger">
              <bean class="org.apache.ignite.logger.jcl.JclLogger">
                  <constructor-arg type="org.apache.commons.logging.Log">
                      <bean class="org.apache.commons.logging.impl.Log4JLogger">
                          <constructor-arg type="java.lang.String" value="config/ignite-log4j.xml"/>
                      </bean>
                  </constructor-arg>
              </bean>
          </property>
          ...

It's recommended to use Ignite's logger injection instead of using/instantiating logger in your task/job code. See `LoggerResource` annotation about logger injection.

# Quiet Mode

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

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

### Method Summary

Methods
`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.
`String` `fileName()` Gets name of the file being logged to if one is configured or `null` otherwise.
`IgniteLogger` `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.
`boolean` `isTraceEnabled()` Tests whether `trace` level is enabled.
`void` `trace(String msg)` Logs out trace message.
`void` `warning(String msg)` Logs out warning message.
`void` `warning(String msg, Throwable e)` Logs out warning message with optional exception.

### Method Detail

#### getLogger

    IgniteLogger 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.

#### trace

    void trace(String msg)

Logs out trace message.

Parameters:
  `msg` - Trace message.

#### 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`).

#### isTraceEnabled

    boolean isTraceEnabled()

Tests whether `trace` level is enabled.

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

#### 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.

#### fileName

    String fileName()

Gets name of the file being logged to if one is configured or `null` otherwise.

Returns:
  Name of the file being logged to if one is configured or `null` otherwise.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.2.0-incubating
Release Date | : June 16 2015