com.quadrique.jbuildingblocks.core.io.logging
Class JbbLogHandler

java.lang.Object
  extended by com.quadrique.jbuildingblocks.core.io.logging.JbbLogHandler

public class JbbLogHandler
extends Object

Sample usage:

Version:
1.0.0
Author:
Hervé Rivere

Constructor Summary
JbbLogHandler()
           
 
Method Summary
static void destroy()
           
static Level getLevelFromString(String logLevel, Level defaultValue)
          To convert a string value into the corresponding log level.
static void init(String zLogFilesName, int zMaxSizeInBytes, int zNbOfLogFiles, Level zInitialLevel)
          Sample use:
JbbLogHandler.init("C:\\Data\\Societe\\Quadrique\\Products\\JBuildingBlocks\\TestData\\taskScheduler\\ts.htm",1000000,1,Level.ALL);
static void init(String zLogFilesName, int zMaxSizeInBytes, int zNbOfLogFiles, Level zInitialLevel, String loggerName)
          Sample use:
JbbLogHandler.init("C:\\Temp\test.log",1000000,1,Level.ALL,"com.quadrique.jbuildingblocks.taskScheduler.controller"); ==> will only log for the corresponding subtree (i.e.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JbbLogHandler

public JbbLogHandler()
Method Detail

init

public static void init(String zLogFilesName,
                        int zMaxSizeInBytes,
                        int zNbOfLogFiles,
                        Level zInitialLevel)
                 throws Exception
Sample use:
JbbLogHandler.init("C:\\Data\\Societe\\Quadrique\\Products\\JBuildingBlocks\\TestData\\taskScheduler\\ts.htm",1000000,1,Level.ALL);

Parameters:
zLogFilesName -
zMaxSizeInBytes -
zNbOfLogFiles -
zInitialLevel -
Throws:
Exception

init

public static void init(String zLogFilesName,
                        int zMaxSizeInBytes,
                        int zNbOfLogFiles,
                        Level zInitialLevel,
                        String loggerName)
                 throws Exception
Sample use:
JbbLogHandler.init("C:\\Temp\test.log",1000000,1,Level.ALL,"com.quadrique.jbuildingblocks.taskScheduler.controller"); ==> will only log for the corresponding subtree (i.e. anything under "com.quadrique.jbuildingblocks.taskScheduler.controller")

Parameters:
zLogFilesName -
zMaxSizeInBytes -
zNbOfLogFiles -
zInitialLevel -
loggerName - e.g. "com.quadrique.jbuildingblocks.taskScheduler.controller"
Throws:
Exception

destroy

public static void destroy()

getLevelFromString

public static Level getLevelFromString(String logLevel,
                                       Level defaultValue)
To convert a string value into the corresponding log level. For instance, given the string " Warning ", the method returns Level.WARNING. It is typically intended to retrieve a log level configuration value from an initialization file.

Parameters:
logLevel - the given log level (the string is trimmed and the comparisons are made in lower case with "warning", "severe", "finer", "fine" and "finest")
defaultValue - if the value could not be converted, the given defaultValue is returned
Returns:
level


Copyright © 2001-2008 Quadrique Corporation. All Rights Reserved.