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 setMinimumPriorityTraced (int priority)
 Set the minimum level of priority to trace.
void trace (int service, int priority, Object obj)
 Trace the Object with specified service and priority to the Log system.

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 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.

Static Protected Attributes

static LogManager instance = null
 Static instance of LogManager.

Member Function Documentation

void org.openmobileis.common.util.log.LogManager.setMinimumPriorityTraced ( int  priority  ) 

Set the minimum level of priority to trace.

For example is set to LogPriorities.ERROR, only ERROR, CRITIQUE, ALERT and EMERGENCY level will be logged

Parameters:
priority 

Definition at line 128 of file LogManager.java.

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 136 of file LogManager.java.

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 147 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 166 of file LogManager.java.

References org.openmobileis.common.util.log.LogTracer.trace().

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 196 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 204 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 212 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 220 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 228 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 236 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 244 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 252 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 260 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 Jan 11 21:19:20 2010 for OpenMobileIS by  doxygen 1.5.4