org.shiftone.jrat.util.log
Class LoggerFactory

java.lang.Object
  extended by org.shiftone.jrat.util.log.LoggerFactory
All Implemented Interfaces:
Constants

public class LoggerFactory
extends java.lang.Object
implements Constants

There are currently 3 ways that logging can be configured...

  • turned off - using NullLogTarget
  • logging to a PrintWriter - System.out or file
  • using thread based logging - each thread can have it's own LogTarget (this is for the Desktop)

    Author:
    jeff@shiftone.org (Jeff Drost)

    Field Summary
     
    Fields inherited from interface org.shiftone.jrat.util.log.Constants
    DEFAULT_LEVEL, LEVEL_DEBUG, LEVEL_ERROR, LEVEL_FATAL, LEVEL_INFO, LEVEL_NAMES, LEVEL_TRACE, LEVEL_WARN
     
    Constructor Summary
    LoggerFactory()
               
     
    Method Summary
    static void disableLogging()
               
    static void enableSystemOutLogging()
               
    static void enableThreadBasedLogging()
               
    static void executeInThreadScope(LogTarget newTarget, java.lang.Runnable runnable)
              this will only have any effect on logging if the current mode is using the ThreadLocalLogTarget - meaning a call to enableDesktopLoggingMode was made.
    static int getLevel()
               
    static int getLevelFromName(java.lang.String levelName)
               
    static Logger getLogger(java.lang.Class klass)
               
    static Logger getLogger(java.lang.String topic)
               
    static LogTarget getLogTarget()
               
    static void initialize()
               
    static void redirectLogging(java.io.PrintWriter printWriter)
               
    static void setLevel(int level)
               
    static void setLogTarget(LogTarget logTarget)
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    LoggerFactory

    public LoggerFactory()
    Method Detail

    initialize

    public static void initialize()

    getLogger

    public static Logger getLogger(java.lang.Class klass)

    getLogger

    public static Logger getLogger(java.lang.String topic)

    getLevelFromName

    public static int getLevelFromName(java.lang.String levelName)

    setLevel

    public static void setLevel(int level)

    getLevel

    public static int getLevel()

    disableLogging

    public static void disableLogging()

    enableThreadBasedLogging

    public static void enableThreadBasedLogging()

    enableSystemOutLogging

    public static void enableSystemOutLogging()

    setLogTarget

    public static void setLogTarget(LogTarget logTarget)

    getLogTarget

    public static LogTarget getLogTarget()

    redirectLogging

    public static void redirectLogging(java.io.PrintWriter printWriter)

    executeInThreadScope

    public static void executeInThreadScope(LogTarget newTarget,
                                            java.lang.Runnable runnable)
    this will only have any effect on logging if the current mode is using the ThreadLocalLogTarget - meaning a call to enableDesktopLoggingMode was made.