Page 1 of 1

--Log4j instead of Logging API

PostPosted: Thu Jan 15, 2015 6:07 pm
by Development@SIB


This article is outdated - please use our new system at

https://doc.sibvisions.com




If you want to use log4j or log4j2 instead of standard Java logging API for your application, simply configure the logger via config.xml of your server zone:

Syntax: [ Download ] [ Hide ]
<?xml version="1.0" encoding="UTF-8"?>

<server>
 
  <logfactory>com.sibvisions.util.log.log4j.Log4jLoggerFactory</logfactory>

  ...
</server>

It's also possible to use log4j(2) for your client application. Simply set the application parameter:

Code: Select all
Launcher.logfactory

via command-line parameter or via application.xml. There's also a constant in javax.rad.application.ILauncher with the name PARAM_LOGFACTORY.

We don't recommend other log APIs than java logging API if you start your JVx application as an Applet, because it makes deployment more complex. But it's possible if you want.

Hint

We have sample files for log4j and log4j2 in our repository.