Getting Started with JLF

 

JLF has three main parts to it.  The first part is the JLF JAR file (jlf.jar) .  Include it in your Java CLASSPATH.  Next, if you are running in a modern Java application server (that is, an application server that supports WAR files), deploy the JLF war file (jlf.war) to your application server and secure access to it (you only want developers/administrators to access these pages, they can run tests on the server like taking it down to make sure something in your system restarts it).  This WAR file contains a number of JSPs to check on (and dynamically change) the operation of JLF as it runs.  For example, you can use the /jlf/log JSPs to dynamically change the logging framework as you run your code in the application server to log to different mechanisms, increase/decrease the volume of log messages for a particular log, and so on.  You can use these JSPs on application servers that don't support WAR files, you just have to unpack the WAR file and put the pages in the right place.  The third piece of JLF is some demonstration applications coded to test how JLF works.  From these applications, you can get an idea of how to use JLF.

JLF uses a small but extendable Configuration Framework to bootstrap the rest of the code in the JAR file.  The Configuration Framework gets very basic JVM (Java Virtual Machine) configuration information, most notably the name of the main application properties file (which configures the basic information for the rest of the layers in JLF) and an application property file directory (so you can create your own sub-property files specific to your own needs, but not have to worry about their correct placement/deployment to servers).  By default, JLF uses App.properties as the main application property file, and looks for that file in the directory you run the "java" start command.  You can override this behavior by specifying -D options on the java start command.  For example, say you have a directory of property files for JLF in /home/myuser/jlfPropertyFiles, and your main application property file is BestAppInWorld.properties.  On your java start command, include:

java ... -Dorg.jlf.config.applicationConfigDir=/home/myuser/jlfPropertyFiles -Dorg.jlf.config.applicationPropertyFile=BestAppInWorld.properties