Log4j instead of Logging API

Documents for the development of and with JVx.

Log4j instead of Logging API

Postby Development@SIB » Thu Jan 15, 2015 6:07 pm

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.
User avatar
Development@SIB
 
Posts: 311
Joined: Mon Sep 28, 2009 1:54 pm

Return to Documentation