Expresso 5-6

com.jcorporate.expresso.core.logging
Class LogHandler

java.lang.Object
  extended byjava.lang.Thread
      extended bycom.jcorporate.expresso.core.registry.ExpressoThread
          extended bycom.jcorporate.expresso.core.logging.LogHandler
All Implemented Interfaces:
Runnable

Deprecated. As of Expresso 5.6 This has not been used since Log4j was integrated with Expresso.

public class LogHandler
extends com.jcorporate.expresso.core.registry.ExpressoThread

The LogHandler is an asynchronous version of logging - it accepts requests to log, then logs them "eventually" in a separate thread

Author:
Michael Nash

Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
LogHandler()
          Deprecated. Constructor
 
Method Summary
 void addToQueue(LogEntry le)
          Deprecated.  
 void finalize()
          Deprecated. If for any reason the app exits, and gc is getting called we need to flush what we've got and then bail.
static void flush()
          Deprecated.  
static void log(int newLevel, String msg)
          Deprecated. Log a new message at the given level, if we log at or above this level
static void log(int newLevel, String objectName, String msg)
          Deprecated. Log the given message at the given level, recording the originating object
static void log(int newLevel, String objectName, String msg, String color)
          Deprecated. Log a message from a particular object with a color at the given level
static void log(int newLevel, String objectName, String msg, String color, String uid, String jobNumber)
          Deprecated. Log a message with the uid and job number recorded as well
static void log(String msg)
          Deprecated. Log the given message at the level 0 (e.g. always log)
static void log(String objectName, String msg)
          Deprecated. Log the given message at level 0 from the named object
static void log(String dbName, String channelName, int newLevel, String objectName, String msg, String color, String uid, String jobNumber)
          Deprecated. Log a message with the uid and job number recorded as well
static void log(String dbName, String channelName, int level, String objectName, Throwable e, String color, String uid, String jobNumber)
          Deprecated. Log an exception from a particular object
static void log(String objectName, String msg, String color)
          Deprecated. Log the given message from an object at level 0
static void log(String objectName, String msg, String color, String uid, String jobNumber)
          Deprecated. Log a message at level 0
static void log(String dbName, String objectName, Throwable e)
          Deprecated. Log an exception from a particular object
static void log(String objectName, Throwable e)
          Deprecated. Log an exception from a particular object
static void log(Throwable e)
          Deprecated. Log an exception
 void run()
          Deprecated. Main thread process of the LogHandler process
static void setDaemonMode(boolean newValue)
          Deprecated. Sets whether the thread, when started will behave in daemon mode or not.
static void setMax(int newMax)
          Deprecated. Set the max size that a log is allowed to reach before it is auto-archived to the old directory
static void startUp()
          Deprecated.  
static void staticAddToQueue(LogEntry le)
          Deprecated. Takes a premade LogEntry and sends it to the logging queue.
static void tryLog(int newLevel, String objectName, String msg, String color)
          Deprecated. Log a message at a given level with an objectname, message, and color.
static void tryLog(String objectName, Exception e)
          Deprecated. Call to log that does not throw any exception, but writes to standard error if the message cannot be logged correctly
static void tryLog(String objectName, String msg)
          Deprecated. Try to log the given message from the given object at level 0 but don't throw an exception if it doesn't work
static void tryLog(String dbName, String channelName, int newLevel, String objectName, String msg, String color)
          Deprecated. Log a message at a given level with an objectname, message, and color.
static void tryLog(String dbName, String channelName, int newLevel, String objectName, String msg, String color, String newUid, String newJobNumber)
          Deprecated. Log a message at a given level with an objectname, message, and color.
static void tryLog(String objectName, String msg, String color)
          Deprecated. Try to log a message at level 0 given the objectname, message, and color.
static void tryLog(String objectName, String msg, String color, String uid, String jobNumber)
          Deprecated. Try to log a message given the object, message, color uid and job number.
 
Methods inherited from class com.jcorporate.expresso.core.registry.ExpressoThread
getThreadContext
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LogHandler

public LogHandler()
Deprecated. 
Constructor

Method Detail

addToQueue

public void addToQueue(LogEntry le)
Deprecated. 
Parameters:
le -

staticAddToQueue

public static void staticAddToQueue(LogEntry le)
Deprecated. 
Takes a premade LogEntry and sends it to the logging queue. Used by the DBAppender.class

Parameters:
le -

finalize

public void finalize()
Deprecated. 
If for any reason the app exits, and gc is getting called we need to flush what we've got and then bail.


flush

public static void flush()
                  throws LogException
Deprecated. 
Throws:
LogException

log

public static void log(int newLevel,
                       String msg)
Deprecated. 
Log a new message at the given level, if we log at or above this level

Parameters:
newLevel - Log level
msg - Message to log

log

public static void log(int newLevel,
                       String objectName,
                       String msg)
                throws LogException
Deprecated. 
Log the given message at the given level, recording the originating object

Parameters:
newLevel - Logging level of this message
objectName - Calling object
msg - Message to log
Throws:
LogException

log

public static void log(int newLevel,
                       String objectName,
                       String msg,
                       String color)
Deprecated. 
Log a message from a particular object with a color at the given level

Parameters:
newLevel - Message level to log
objectName - Calling object
msg - Message to log
color - Color to log the message with

log

public static void log(int newLevel,
                       String objectName,
                       String msg,
                       String color,
                       String uid,
                       String jobNumber)
Deprecated. 
Log a message with the uid and job number recorded as well

Parameters:
newLevel - Level of this message
objectName - Calling object
msg - Message to log
color - Color to log the message
uid - User Name
jobNumber - Job Number

log

public static void log(Throwable e)
                throws LogException
Deprecated. 
Log an exception

Parameters:
e - Exception to log
Throws:
LogException - If the log entry cannot be written

log

public static void log(String msg)
Deprecated. 
Log the given message at the level 0 (e.g. always log)

Parameters:
msg - Message to log

log

public static void log(String objectName,
                       Throwable e)
                throws LogException
Deprecated. 
Log an exception from a particular object

Parameters:
objectName - Calling object
e - Exception to log
Throws:
LogException

log

public static void log(String objectName,
                       String msg)
                throws LogException
Deprecated. 
Log the given message at level 0 from the named object

Parameters:
objectName - Calling object
msg - Message to log
Throws:
LogException - if the message cannot be logged

log

public static void log(String dbName,
                       String channelName,
                       int level,
                       String objectName,
                       Throwable e,
                       String color,
                       String uid,
                       String jobNumber)
                throws LogException
Deprecated. 
Log an exception from a particular object

Parameters:
dbName -
channelName -
level -
objectName -
e -
color -
uid -
jobNumber -
Throws:
LogException

log

public static void log(String dbName,
                       String channelName,
                       int newLevel,
                       String objectName,
                       String msg,
                       String color,
                       String uid,
                       String jobNumber)
Deprecated. 
Log a message with the uid and job number recorded as well

Parameters:
dbName - Database/config key name to use
channelName - of this logging "channel"
newLevel - Level of this message
objectName - Calling object
msg - Message to log
color - Color to log the message
uid - User Name
jobNumber - Job Number

log

public static void log(String dbName,
                       String objectName,
                       Throwable e)
                throws LogException
Deprecated. 
Log an exception from a particular object

Parameters:
dbName -
objectName - Calling object
e - Exception to log
Throws:
LogException

log

public static void log(String objectName,
                       String msg,
                       String color)
Deprecated. 
Log the given message from an object at level 0

Parameters:
objectName - Calling object
msg - Message to log
color - Color to log the message with

log

public static void log(String objectName,
                       String msg,
                       String color,
                       String uid,
                       String jobNumber)
Deprecated. 
Log a message at level 0

Parameters:
objectName - Calling object
msg - Message to log
color - Color to log the message
uid - User Id
jobNumber - Job Number

run

public void run()
Deprecated. 
Main thread process of the LogHandler process


setMax

public static void setMax(int newMax)
Deprecated. 
Set the max size that a log is allowed to reach before it is auto-archived to the old directory

Parameters:
newMax - Max size of the new log in records

setDaemonMode

public static void setDaemonMode(boolean newValue)
Deprecated. 
Sets whether the thread, when started will behave in daemon mode or not. If you're running test cases, you want it true so everything will exit properly. But in secure environments, some things might not get logged if you have daemonMode==true. So leave it at it's default of false.


startUp

public static void startUp()
Deprecated. 

tryLog

public static void tryLog(int newLevel,
                          String objectName,
                          String msg,
                          String color)
Deprecated. 
Log a message at a given level with an objectname, message, and color. Does not throw exception if message cannot be logged

Parameters:
newLevel -
objectName -
msg -
color -

tryLog

public static void tryLog(String objectName,
                          Exception e)
Deprecated. 
Call to log that does not throw any exception, but writes to standard error if the message cannot be logged correctly

Parameters:
objectName - Name of the object logging the message
e - Exception being logged

tryLog

public static void tryLog(String objectName,
                          String msg)
Deprecated. 
Try to log the given message from the given object at level 0 but don't throw an exception if it doesn't work

Parameters:
objectName -
msg -

tryLog

public static void tryLog(String dbName,
                          String channelName,
                          int newLevel,
                          String objectName,
                          String msg,
                          String color)
Deprecated. 
Log a message at a given level with an objectname, message, and color. Does not throw exception if message cannot be logged

Parameters:
dbName -
channelName -
newLevel -
objectName -
msg -
color -

tryLog

public static void tryLog(String dbName,
                          String channelName,
                          int newLevel,
                          String objectName,
                          String msg,
                          String color,
                          String newUid,
                          String newJobNumber)
Deprecated. 
Log a message at a given level with an objectname, message, and color. Does not throw exception if message cannot be logged

Parameters:
dbName -
channelName -
newLevel -
objectName -
msg -
color -
newUid -
newJobNumber -

tryLog

public static void tryLog(String objectName,
                          String msg,
                          String color)
Deprecated. 
Try to log a message at level 0 given the objectname, message, and color. No exception if unable to be logged.

Parameters:
objectName -
msg -
color -

tryLog

public static void tryLog(String objectName,
                          String msg,
                          String color,
                          String uid,
                          String jobNumber)
Deprecated. 
Try to log a message given the object, message, color uid and job number. No exception if message cannot be logged

Parameters:
objectName -
msg -
color -
uid -
jobNumber -

Expresso 5-6

Please see www.jcorporate.com for information about new Expresso releases.