public class JclLogger extends Object implements IgniteLogger
Here is an example of configuring JCL logger in Ignite configuration Spring file to work over log4j implementation. Note that we use the same configuration file as we provide by default:
...
<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>
...
If you are using system properties to configure JCL logger use following configuration:
...
<property name="gridLogger">
<bean class="org.apache.ignite.logger.jcl.JclLogger"/>
</property>
...
And the same configuration if you'd like to configure Ignite in your code:
IgniteConfiguration cfg = new IgniteConfiguration();
...
IgniteLogger log = new JclLogger(new Log4JLogger("config/ignite-log4j.xml"));
...
cfg.setGridLogger(log);
or following for the configuration by means of system properties:
IgniteConfiguration cfg = new IgniteConfiguration();
...
IgniteLogger log = new JclLogger();
...
cfg.setGridLogger(log);
It's recommended to use Ignite logger injection instead of using/instantiating
logger in your task/job code. See LoggerResource annotation about logger
injection.
DEV_ONLY| Constructor and Description |
|---|
JclLogger()
Creates new logger.
|
JclLogger(org.apache.commons.logging.Log impl)
Creates new logger with given implementation.
|
| Modifier and Type | Method and Description |
|---|---|
void |
debug(String msg) |
void |
error(String msg) |
void |
error(String msg,
@Nullable Throwable e) |
@Nullable String |
fileName() |
IgniteLogger |
getLogger(Object ctgr) |
void |
info(String msg) |
boolean |
isDebugEnabled() |
boolean |
isInfoEnabled() |
boolean |
isQuiet() |
boolean |
isTraceEnabled() |
String |
toString() |
void |
trace(String msg) |
void |
warning(String msg) |
void |
warning(String msg,
@Nullable Throwable e) |
public JclLogger()
public JclLogger(org.apache.commons.logging.Log impl)
impl - JCL implementation to use.public IgniteLogger getLogger(Object ctgr)
getLogger in interface IgniteLoggerpublic void trace(String msg)
trace in interface IgniteLoggerpublic void debug(String msg)
debug in interface IgniteLoggerpublic void info(String msg)
info in interface IgniteLoggerpublic void warning(String msg)
warning in interface IgniteLoggerpublic void warning(String msg, @Nullable @Nullable Throwable e)
warning in interface IgniteLoggerpublic void error(String msg)
error in interface IgniteLoggerpublic boolean isQuiet()
isQuiet in interface IgniteLoggerpublic void error(String msg, @Nullable @Nullable Throwable e)
error in interface IgniteLoggerpublic boolean isTraceEnabled()
isTraceEnabled in interface IgniteLoggerpublic boolean isDebugEnabled()
isDebugEnabled in interface IgniteLoggerpublic boolean isInfoEnabled()
isInfoEnabled in interface IgniteLogger@Nullable public @Nullable String fileName()
fileName in interface IgniteLogger
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 8.9.14-p2 Release Date : January 19 2026