org.openmobileis.common.util.log.LogManager Class Reference

Inheritance diagram for org.openmobileis.common.util.log.LogManager:

org.openmobileis.common.util.log.FileLogManager org.openmobileis.common.util.log.FileOpenCloseLogManager List of all members.

Detailed Description

This class permits to manage log.

LogManager is an abstract class to hide the underneath log. It can be mapped to Log4J or other log API. We provide default log for console and file log. Any other log manager can be plug.

Default log id define with tree parameters : service : the service that log. defined by the class LogServices. priority : the log priority defined by the class LogPriorities. the log object. The toString method is call on the object except for exception where the printStackTrace methode is call.

Some helper method is defined to faclitate the use of log that define default values for Service or priority.

LogManager is initialized by calling the getInstance method. If null is provided, default console logging is set. All log are done using LogManager class.

 exemple :
   ....
  public void methodRed () {
    ....
    LogManager.traceInfo(0, "Log in methodRed");
    ....
    ....
    try {
    } catch (java.lang.OpenMSPException exec ) {
      LogManager.traceError(0, exec);
    }

  }

Author:
P.Delrieu
Version:
1.0
Since:
JDK1.1
See also:
:org.openmobileis.common.util.log.LogPriorities

:org.openmobileis.common.util.log.LogServices

Definition at line 85 of file LogManager.java.

Public Member Functions

void trace (int service, int priority, Object obj)
 Trace the Object with specified service and priority to the Log system.
LogTracer getLogTracer ()
void setLogTracer (LogTracer t)

Static Public Member Functions

static void attachLogTracerToPriority (int priority, LogTracer t)
 attache the specified logTracer to a priority.
static synchronized LogManager getInstance ()
 <FONT color="#009999"> This methods return the only LogManager instance.
static synchronized void registerLogManager (Properties props)
static void trace (OpenMISException exp)
static void traceEmergency (int service, Object obj)
 Trace the Object in EMERGENCY priority with specified service to the Log system.
static void traceCritique (int service, Object obj)
 Trace the Object in CRITIQUE priority with specified service to the Log system.
static void traceAlert (int service, Object obj)
 Trace the Object in ALERT priority with specified service to the Log system.
static void traceError (int service, Object obj)
 Trace the Object in ERROR priority with specified service to the Log system.
static void traceWarning (int service, Object obj)
 Trace the Object in WARNING priority with specified service to the Log system.
static void traceNotice (int service, Object obj)
 Trace the Object in NOTICE priority with specified service to the Log system.
static void traceInfo (int service, Object obj)
 Trace the Object in INFO priority with specified service to the Log system.
static void traceDebug (int service, Object obj)
 Trace the Object in DEBUG priority with specified service to the Log system.
static void traceUserSynchro (int service, Object obj)
 Trace the Object in DEBUG priority with specified service to the Log system.

Protected Member Functions

 LogManager (Properties props)
 The constructor is protected in order to use the class LogManager like a singleton.
 LogManager ()

Protected Attributes

LogTracer tracer

Static Protected Attributes

static LogManager instance = null
 Static instance of LogManager.
static HashMap logTable


Member Function Documentation

static void org.openmobileis.common.util.log.LogManager.attachLogTracerToPriority ( int  priority,
LogTracer  t 
) [static]

attache the specified logTracer to a priority.

No attached priority use the default logTracer to trace. Attached priority will use the specified tracer to log.

Definition at line 116 of file LogManager.java.

References org.openmobileis.common.util.log.LogManager.logTable.

static synchronized LogManager org.openmobileis.common.util.log.LogManager.getInstance (  )  [static]

<FONT color="#009999"> This methods return the only LogManager instance.

</FONT>

Returns:
the only instance

Definition at line 127 of file LogManager.java.

References org.openmobileis.common.util.log.LogManager.instance.

void org.openmobileis.common.util.log.LogManager.trace ( int  service,
int  priority,
Object  obj 
)

Trace the Object with specified service and priority to the Log system.

If object is an exception the track is traced.

Definition at line 145 of file LogManager.java.

References org.openmobileis.common.util.log.LogManager.logTable, org.openmobileis.common.util.log.LogTracer.trace(), and org.openmobileis.common.util.log.LogManager.tracer.

static void org.openmobileis.common.util.log.LogManager.traceEmergency ( int  service,
Object  obj 
) [static]

Trace the Object in EMERGENCY priority with specified service to the Log system.

If object is an exception the track is traced.

Definition at line 174 of file LogManager.java.

References org.openmobileis.common.util.log.LogManager.instance, and org.openmobileis.common.util.log.LogManager.trace().

static void org.openmobileis.common.util.log.LogManager.traceCritique ( int  service,
Object  obj 
) [static]

Trace the Object in CRITIQUE priority with specified service to the Log system.

If object is an exception the track is traced.

Definition at line 182 of file LogManager.java.

References org.openmobileis.common.util.log.LogManager.instance, and org.openmobileis.common.util.log.LogManager.trace().

static void org.openmobileis.common.util.log.LogManager.traceAlert ( int  service,
Object  obj 
) [static]

Trace the Object in ALERT priority with specified service to the Log system.

If object is an exception the track is traced.

Definition at line 190 of file LogManager.java.

References org.openmobileis.common.util.log.LogManager.instance, and org.openmobileis.common.util.log.LogManager.trace().

static void org.openmobileis.common.util.log.LogManager.traceError ( int  service,
Object  obj 
) [static]

Trace the Object in ERROR priority with specified service to the Log system.

If object is an exception the track is traced.

Definition at line 198 of file LogManager.java.

References org.openmobileis.common.util.log.LogManager.instance, and org.openmobileis.common.util.log.LogManager.trace().

static void org.openmobileis.common.util.log.LogManager.traceWarning ( int  service,
Object  obj 
) [static]

Trace the Object in WARNING priority with specified service to the Log system.

If object is an exception the track is traced.

Definition at line 206 of file LogManager.java.

References org.openmobileis.common.util.log.LogManager.instance, and org.openmobileis.common.util.log.LogManager.trace().

static void org.openmobileis.common.util.log.LogManager.traceNotice ( int  service,
Object  obj 
) [static]

Trace the Object in NOTICE priority with specified service to the Log system.

If object is an exception the track is traced.

Definition at line 214 of file LogManager.java.

References org.openmobileis.common.util.log.LogManager.instance, and org.openmobileis.common.util.log.LogManager.trace().

static void org.openmobileis.common.util.log.LogManager.traceInfo ( int  service,
Object  obj 
) [static]

Trace the Object in INFO priority with specified service to the Log system.

If object is an exception the track is traced.

Definition at line 222 of file LogManager.java.

References org.openmobileis.common.util.log.LogManager.instance, and org.openmobileis.common.util.log.LogManager.trace().

static void org.openmobileis.common.util.log.LogManager.traceDebug ( int  service,
Object  obj 
) [static]

Trace the Object in DEBUG priority with specified service to the Log system.

If object is an exception the track is traced.

Definition at line 230 of file LogManager.java.

References org.openmobileis.common.util.log.LogManager.instance, and org.openmobileis.common.util.log.LogManager.trace().

static void org.openmobileis.common.util.log.LogManager.traceUserSynchro ( int  service,
Object  obj 
) [static]

Trace the Object in DEBUG priority with specified service to the Log system.

If object is an exception the track is traced.

Definition at line 238 of file LogManager.java.

References org.openmobileis.common.util.log.LogManager.instance, and org.openmobileis.common.util.log.LogManager.trace().


The documentation for this class was generated from the following file:
Generated on Mon Dec 4 11:03:34 2006 for OpenMobileIS by  doxygen 1.5.1-p1