Why do it?
By default, LuciadLightspeed and LuciadFusion use the java.util.logger
package to log application messages .
If your application uses a logging framework other than the default Java logging framework, you can re-configure LuciadLightspeed
and LuciadFusion to dispatch log messages to that framework.
How to do it?
At initialization, LuciadLightspeed and LuciadFusion instantiate a global ILcdLoggerFactory
that determines to which framework all logging output is sent. Most logging frameworks have a very similar API, so it’s
usually quite straightforward to write an implementation of ILcdLoggerFactory
for your preferred logging framework.
To connect to your logging framework, add a file called com.luciad.util.logging.ILcdLoggerFactory
inside a META-INF/services
directory that is accessible from the classpath. This file must contain a single line with the name of your factory class.
For example:
samples.common.logging.SLF4JLoggerFactory
And that’s all there is to it.
For your convenience, SLF4JLoggerFactory
is availabe as a sample class.