@GridToStringExclude
public interface IgniteLogger
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.
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.
Modifier and Type | Field and Description |
---|---|
static String |
DEV_ONLY
Marker for log messages that are useful in development environments, but not in production.
|
Modifier and Type | Method and Description |
---|---|
void |
debug(String msg)
Logs out debug message.
|
default void |
debug(@Nullable String marker,
String msg)
Logs out debug message.
|
default void |
error(String msg)
Logs out error message.
|
default void |
error(@Nullable String marker,
String msg,
@Nullable Throwable e)
Logs error message with optional exception.
|
void |
error(String msg,
@Nullable 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.
|
default void |
info(@Nullable String marker,
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 Logger is in "Quiet mode".
|
boolean |
isTraceEnabled()
Tests whether
trace level is enabled. |
void |
trace(String msg)
Logs out trace message.
|
default void |
trace(@Nullable String marker,
String msg)
Logs out trace message.
|
default void |
warning(String msg)
Logs out warning message.
|
default void |
warning(@Nullable String marker,
String msg,
@Nullable Throwable e)
Logs out warning message with optional exception.
|
void |
warning(String msg,
@Nullable Throwable e)
Logs out warning message with optional exception.
|
static final String DEV_ONLY
IgniteLogger getLogger(Object ctgr)
ctgr
- Category for new logger.void trace(String msg)
msg
- Trace message.default void trace(@Nullable @Nullable String marker, String msg)
this.trace(msg)
.marker
- Name of the marker to be associated with the message.msg
- Trace message.void debug(String msg)
msg
- Debug message.default void debug(@Nullable @Nullable String marker, String msg)
this.debug(msg)
.marker
- Name of the marker to be associated with the message.msg
- Debug message.void info(String msg)
msg
- Information message.default void info(@Nullable @Nullable String marker, String msg)
this.info(msg)
.marker
- Name of the marker to be associated with the message.msg
- Information message.default void warning(String msg)
msg
- Warning message.void warning(String msg, @Nullable @Nullable Throwable e)
msg
- Warning message.e
- Optional exception (can be null
).default void warning(@Nullable @Nullable String marker, String msg, @Nullable @Nullable Throwable e)
this.warning(msg)
.marker
- Name of the marker to be associated with the message.msg
- Warning message.e
- Optional exception (can be null
).default void error(String msg)
msg
- Error message.void error(String msg, @Nullable @Nullable Throwable e)
msg
- Error message.e
- Optional exception (can be null
).default void error(@Nullable @Nullable String marker, String msg, @Nullable @Nullable Throwable e)
this.error(msg)
.marker
- Name of the marker to be associated with the message.msg
- Error message.e
- Optional exception (can be null
).boolean isTraceEnabled()
trace
level is enabled.true
in case when trace
level is enabled, false
otherwise.boolean isDebugEnabled()
debug
level is enabled.true
in case when debug
level is enabled, false
otherwise.boolean isInfoEnabled()
info
level is enabled.true
in case when info
level is enabled, false
otherwise.boolean isQuiet()
true
"Quiet mode" is enabled, false
otherwiseString fileName()
null
otherwise.null
otherwise.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.7.2 Release Date : February 6 2019